title: Converting R code into python code
body: <p>working code in R </p>
  
  <pre><code>library(dplyr)
  tmp &lt;- test %&gt;% 
         group_by(InvoiceDocNumber) %&gt;% 
         summarise(invoiceprob=max(itemprob)) %&gt;% 
         mutate(invoicerank=rank(desc(invoiceprob)))
  </code></pre>
  
  <p>But I want to rewrite the code in python. I wrote the below code but it's throwing me the error. I am using the similar version of dplyr which is available in python.</p>
  
  <pre><code>from dfply import *
  tmp = (test &gt;&gt;
         group_by(test.InvoiceDocNumber) &gt;&gt; 
         summarize(invoiceprob=max(test.itemprob)) &gt;&gt;
         mutate(invoicerank=rankdata(test.invoiceprob)))
  
  AttributeError: 'DataFrame' object has no attribute 'invoiceprob'
  </code></pre>
  
  <p>Can anyone help me ?</p>