3 ms·
> What I think would be a nice approach would be someone creating a new Dataframe class that merely inherits from a Pandas dataframe but just implementing .filt
by ellisv 6y ago
> What I think would be a nice approach would be someone creating a new Dataframe class that merely inherits from a Pandas dataframe but just implementing .filter(), .summarise(), .select() etc. as methods, using the dplyr syntax. If they return their own dataframes then chaining follows naturally.
> I know that isn't how dplyr works, but it feels more Pythonic, and this solution isn't entirely analogous to dplyr anyway.
I think I agree. Pandas has a lot of overhead/baggage that I don't want 90% of the time. Being able to chain _simple_ verbs on a data frame would be great -- something like mtcars.groupby(cyl).summarize(avg_hp = hp.mean())
- closed 6y agoI'm still debating chaining vs piping, but you can do.. from siuba import _ from siuba.data import mtcars # mtcars is a pandas DataFrame mtcars \ .groupby("cyl") \ .siu_summarize(avg_hp=_.hp.mean())