Skip to content
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

version 0.11 issues with to_csv #3489

Closed
superkeyor opened this issue Apr 30, 2013 · 4 comments
Closed

version 0.11 issues with to_csv #3489

superkeyor opened this issue Apr 30, 2013 · 4 comments
Labels
Milestone

Comments

@superkeyor
Copy link

It looks like that some changes were made to the DataFrame.to_csv method, as mentioned in the what's new document.

Today I found two issues with the updated to_csv:

  1. I have an int column, when I use floatformat parameter, the int are changed to float
  2. cols parameter simply changes the name of columns, it does not reorder the data in a whole column.

Thanks for your hard working. Hope we can make pandas less buggy and more powerful!

@ghost
Copy link

ghost commented Apr 30, 2013

2 was fixed in master a few days ago and will be in 0.11.1 #3454, the bugfix release due in a few weeks.

@jreback
Copy link
Contributor

jreback commented Apr 30, 2013

can you give an example of your 1)?

@jreback
Copy link
Contributor

jreback commented May 8, 2013

@jerryzhujian9 can you give us an example for 1)?

@ghost
Copy link

ghost commented May 10, 2013

This works just fine:

df.to_csv("/tmp/1.csv",float_format="%.2f")
pd.read_csv("/tmp/1.csv").info()

<class 'pandas.core.frame.DataFrame'>
Int64Index: 10 entries, 0 to 9
Data columns (total 3 columns):
R0         10  non-null values
C_l0_g0    10  non-null values
C_l0_g1    10  non-null values
dtypes: int64(2), object(1)

Closing as can't repro. @jerryzhujian9 will gladly reopen if you provide steps to reproduce.

@ghost ghost closed this as completed May 10, 2013
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants