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

pandas.DataFrame.to_clipboard with excel option does not parse into columns with 0.23 #21104

kentmaxwell opened this Issue May 17, 2018 · 3 comments


None yet
5 participants

kentmaxwell commented May 17, 2018

Problem description

With Version 0.23 of pandas, the function .to_clipboard(), with the option excel=True no longer produces a copy of the dataframe which is Excel friendly when pasting the data into an Excel worksheet. All the data comes into a single column in the Excel workbook. Previously, the data would parse across all the columns.

The code that demonstrates this situation is:

Import pandas as pd
df = pd.DataFrame(np.random.randn(5,10))


The output in excel ends up looking like this:

Output of pd.show_versions()


commit: None
python-bits: 64
OS: Darwin
OS-release: 17.5.0
machine: x86_64
processor: i386
byteorder: little

pandas: 0.23.0
pytest: 3.5.1
pip: 10.0.1
setuptools: 39.1.0
Cython: 0.28.2
numpy: 1.13.3
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 6.4.0
sphinx: 1.7.4
patsy: 0.5.0
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: 1.2.1
tables: 3.4.3
numexpr: 2.6.5
feather: None
matplotlib: 2.2.2
openpyxl: 2.5.3
xlrd: 1.1.0
xlwt: 1.2.0
xlsxwriter: 1.0.4
lxml: 4.2.1
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: 1.2.7
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None


This comment has been minimized.


WillAyd commented May 17, 2018

Quick debug shows me that what was previously tab delimited is now showing up with spaces, hence why the paste to Excel does not work.

Investigation / PRs are welcome!

@chris-b1 chris-b1 added this to the 0.23.1 milestone May 17, 2018


This comment has been minimized.


chris-b1 commented May 17, 2018

Ugh, sorry about this, I use this all the time and should have caught it in the RC. I'll eventually get this, or please feel to take look first!


This comment has been minimized.


jcjf commented Jun 28, 2018

The problem was introduced in #18968, when '\t' started becoming r'\t' in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment