working code in R
library(dplyr)
tmp <- test %>%
group_by(InvoiceDocNumber) %>%
summarise(invoiceprob=max(itemprob)) %>%
mutate(invoicerank=rank(desc(invoiceprob)))
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.
from dfply import *
tmp = (test >>
group_by(test.InvoiceDocNumber) >>
summarize(invoiceprob=max(test.itemprob)) >>
mutate(invoicerank=rankdata(test.invoiceprob)))
AttributeError: 'DataFrame' object has no attribute 'invoiceprob'
Can anyone help me ?