-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
to_clipboard wrong linebreaks on Windows #11720
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
you might need to specifier the separator, this is using |
This helps:
P.S. you mean to_csv? i think \r\n should be default terminator, cause it concerns Excel=True argument |
sorry, meant |
What? I do not understand.) It also implies line_terminator to be '\r\n', cause we're going to paste data in Excel. But it is '\n' by default. |
@Winand sorry, was distracted a bit.....yes it is whatever the default |
@jreback i mean: |
but this DOES work on windows. can you give a copy-pastable example where this does not work? I am not sure how QT interacts with things in any event. |
I see that. Hmm, must have always been like that. @sinhrks @TomAugspurger ever seen this? does it matter? |
Haven't tried to_clipboard -> excel before, but just tested it on windows and I see the extra line. Not sure what if anything this could break if we change the default. Presumably people on Windows would expect the default to be |
Confirmed the issue on my Windows also. And changing line sep sounds valid. I think we can use |
this is actually tricky because say you do Though I suppose non-windows platforms can handle the e.g. do these produce differing results on non-windows? (these work for me on macosx)
so is soln just to default |
anyone want to do a PR for this? |
here it is #12131 |
4a1a330 |
Copying dataframe with to_clipboard and Qt gives different results: when pasted to Excel there's one more empty line. It may be unexpected and overwrite important data.
When looking into clipboard with Free Clipboard Viewer we can see that Qt uses CR+LF linebreaks:


and pandas uses LF:
Maybe this is the source of problem.
(This isn't fixed by #9693)
The text was updated successfully, but these errors were encountered: