-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
pandas.core.groupby.DataFrameGroupBy to_csv method doesn't ouput csv file as expected #4882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What is your end goal here? You shouldn't really be using for group_name, df in df.groupby('Name'):
newdf = process(df)
with open('the_csv.csv', 'a') as f:
df.to_csv(f) |
If you REALLY want the output you have, you can do this, but as @cpcloud , I don't see utility in this
|
This issue is linked to #4883 |
Why does a group by object even have a to_csv method? |
it doesn't, its dispatching to the object (which is how apply works) |
Because it creates a wrapper for the type of groupby lazily |
I suppose should explicity allow certain methods on groupby |
maybe although special casing everything could turn into a mess |
well not everything but none of the IO stuff really makes sense on a groupby |
Yeah not worth the time. |
One thing we could do is implement dir on the object so it's clearer |
let me take a look at how that wrapper is constructed....it might be deep in some |
closed by #4887 |
(Why some data are output to ipython console ?)
The text was updated successfully, but these errors were encountered: