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

BUG: Don't print stray newline with MultiIndex #14132

Closed
wants to merge 1 commit into from

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Sep 1, 2016

Title is self-explanatory.

Closes #6618.

@codecov-io
Copy link

codecov-io commented Sep 1, 2016

Current coverage is 85.27% (diff: 100%)

Merging #14132 into master will decrease coverage by <.01%

@@             master     #14132   diff @@
==========================================
  Files           139        139          
  Lines         50553      50554     +1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43110      43110          
- Misses         7443       7444     +1   
  Partials          0          0          

Powered by Codecov. Last update 58199c5...d1a600f

df = DataFrame([1], columns=pd.MultiIndex.from_arrays([[1],[2]]))

exp = ",1\n,2\n,\n0,1\n"
self.assertEqual(df.to_csv(), exp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test with mi names as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, done.

@jreback jreback added Output-Formatting __repr__ of pandas objects, to_string IO CSV read_csv, to_csv labels Sep 2, 2016
@jreback jreback added this to the 0.19.0 milestone Sep 2, 2016
@jreback jreback closed this in 362a561 Sep 2, 2016
@jreback
Copy link
Contributor

jreback commented Sep 2, 2016

thanks!

@gfyoung gfyoung deleted the to-csv-newline branch September 2, 2016 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants