-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: to_xml
raises KeyError
for index=False
when the index does not start at zero
#42458
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
Closed
3 tasks done
Closed
3 tasks done
Comments
stephan-hesselmann-by
added a commit
to stephan-hesselmann-by/pandas
that referenced
this issue
Jul 9, 2021
Fixes pandas-dev#42458 It was assumed that the index contains the element `0`. This led to a defect when the index of the input Dataframe has an offset, which is a common use case when streaming Dataframes via generators. This fix consists of not relying on accessing the `0` element of `frame_dicts`.
4 tasks
stephan-hesselmann-by
added a commit
to stephan-hesselmann-by/pandas
that referenced
this issue
Jul 9, 2021
Fixes pandas-dev#42458 It was assumed that the index contains the element `0`. This led to a defect when the index of the input Dataframe has an offset, which is a common use case when streaming Dataframes via generators. This fix consists of not relying on accessing the `0` element of `frame_dicts`.
stephan-hesselmann-by
added a commit
to stephan-hesselmann-by/pandas
that referenced
this issue
Jul 9, 2021
Fixes pandas-dev#42458 It was assumed that the index contains the element `0`. This led to a defect when the index of the input Dataframe has an offset, which is a common use case when streaming Dataframes via generators. This fix consists of not relying on accessing the `0` element of `frame_dicts`.
stephan-hesselmann-by
added a commit
to stephan-hesselmann-by/pandas
that referenced
this issue
Jul 9, 2021
Fixes pandas-dev#42458 It was assumed that the index contains the element `0`. This led to a defect when the index of the input Dataframe has an offset, which is a common use case when streaming Dataframes via generators. This fix consists of not relying on accessing the `0` element of `frame_dicts`.
stephan-hesselmann-by
added a commit
to stephan-hesselmann-by/pandas
that referenced
this issue
Jul 11, 2021
Fixes pandas-dev#42458 It was assumed that the index contains the element `0`. This led to a defect when the index of the input Dataframe has an offset, which is a common use case when streaming Dataframes via generators. This fix consists of not relying on accessing the `0` element of `frame_dicts`.
Good catch! Yes. zero should not be hard-coded in handling indexes: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
This code snipped should not raise a
KeyError
. The index should be ignored regardless of its content.Traceback:
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : f00ed8f
python : 3.9.6.final.0
python-bits : 64
OS : Darwin
OS-release : 20.5.0
Version : Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.0
numpy : 1.21.0
pytz : 2021.1
dateutil : 2.8.1
pip : 21.1.3
setuptools : None
Cython : None
pytest : 6.2.4
hypothesis : None
sphinx : 4.0.3
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.3
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : None
pandas_datareader: None
bs4 : 4.9.3
bottleneck : None
fsspec : 2021.06.1
fastparquet : None
gcsfs : None
matplotlib : 3.4.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 4.0.1
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : 1.4.15
tables : None
tabulate : 0.8.9
xarray : None
xlrd : None
xlwt : None
numba : None
None
The text was updated successfully, but these errors were encountered: