-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: Note itertuples created with rename=True
#50836
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
This is as intended as the namedtuples are generated with And this is tested in This could be better documented |
rename=True
Oh actually this is documented in the docstring https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.itertuples.html
Therefore closing |
Thanks 👍 |
Might not be bad to add a reference to this: https://realpython.com/python-keywords/ |
Or at least this: https://docs.python.org/3/library/keyword.html |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
The column named "yield" is renamed in
itertuples
.Expected Behavior
The column name remains unchanged.
Installed Versions
INSTALLED VERSIONS
commit : 8dab54d
python : 3.9.15.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.0-58-generic
Version : #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.5.2
numpy : 1.23.5
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 66.0.0
pip : 22.3.1
Cython : None
pytest : 7.2.1
hypothesis : None
sphinx : 5.3.0
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : 2.9.3
jinja2 : 3.1.2
IPython : 8.8.0
pandas_datareader: None
bs4 : 4.11.1
bottleneck : 1.3.5
brotli :
fastparquet : None
fsspec : 2022.11.0
gcsfs : None
matplotlib : 3.6.2
numba : 0.56.4
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 9.0.0
pyreadstat : None
pyxlsb : None
s3fs : 2022.11.0
scipy : 1.10.0
snappy : None
sqlalchemy : 1.4.46
tables : None
tabulate : 0.9.0
xarray : 2022.12.0
xlrd : None
xlwt : None
zstandard : None
tzdata : 2022.7
The text was updated successfully, but these errors were encountered: