-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
df.to_excel gives TypeError #30106
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
Hi could I take this up as a first issue? I'm not quite sure how to assign it to myself. I didn't understand "For this reason, we implemented a workaround consisting of adding a comment with the exact text take. When you do it, a GitHub action will automatically assign you the issue" when reading the contributions page. |
This is a problem in openpyxl 3.0.2, you should be OK if you downgrade to 3.0.1 |
Hey @jbrockmendel sorry for delayed reply |
As a general rule, yes, but in this case there is a bug specific to openpyxl 3.0.2, see #29862 |
Code Sample, a copy-pastable example if possible
where output of
df
is:and file example is:
Problem description
The to_excel function of class dataframe must write the dataframe in the specified excel file instead it returns error:
trying to open written file using
df = pd.read_excel('Excel_Sample.xlsx',sheet_name='Sheet1')
returns error:
Expected Output
The excel file should be written correctly with the dataframe's data.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.6.8.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-70-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_IN
LOCALE : en_IN.ISO8859-1
pandas : 0.25.3
numpy : 1.16.3
pytz : 2018.7
dateutil : 2.8.0
pip : 19.3.1
setuptools : 41.0.1
Cython : None
pytest : 3.9.3
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.3.3
html5lib : 1.0.1
pymysql : 0.9.3
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.0.1
pandas_datareader: None
bs4 : 4.8.0
bottleneck : 1.2.1
fastparquet : None
gcsfs : None
lxml.etree : 4.3.3
matplotlib : 3.0.3
numexpr : 2.7.0
odfpy : None
openpyxl : 3.0.2
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.1.0
sqlalchemy : 1.3.11
tables : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: