-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DataFrame.iat will create new column if .iat is used to set None on int Series #23236
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
I tried it with 0.23.4 and had the same output.
INSTALLED VERSIONS
------------------
commit: None
python: 3.6.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-24-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.utf8
LOCALE: en_US.UTF-8
pandas: 0.23.4 |
Thanks for the report. Investigations and PRs welcome! |
I think we can conclude that as df.iat is capable of creating and setting values,it will create index for 0 which is not present as column index(a,b). |
IIRC |
I do not agree with @aditya0811 :
As explained by @mroeschke here:
|
- in response to pandas-devgh-23236 - changes the fallback of .iat to .iloc on type error
Code Sample, a copy-pastable example if possible
Problem description
This is problematic for multiple reasons.
This is likely related to the non-intuitive behavior of Series which has already been documented here:
#20643 (comment)
Expected Output
I would expect it to do what it does when using
.iloc
:Output of
pd.show_versions()
pandas: 0.22.0
pytest: None
pip: 9.0.3
setuptools: 39.0.1
Cython: 0.27.3
numpy: 1.14.0
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: 0.5.0
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: 0.1.2
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: