-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REGR: fillna not filling NaNs after pivot without explicitly listing pivot values #36495
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 confirm this issue ! |
Thanks @miles82 for the nice report and @samilAyoub for confirming. 760ba37 is the first bad commit
pandas/core/generic.py | 9 --------- PR #34389 |
moved off 1.1.3 milestone, see #36668 (comment) |
moved off 1.1.4 milestone (scheduled for release tomorrow) |
@jbrockmendel do you have time to take a look at this? |
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.
Hi,
I have this (simplified) piece of code which seems to have stopped working correctly in Pandas 1.1:
Problem description
This is the output in Pandas 1.1.2:
It contains NaNs after using fillna. It can be fixed by explicitly providing remaining columns as values to pivot (which should be the default):
df = df.pivot('i1', 'i2', values=['i3', 'f1'])
It also works if all columns are of the same type, like when I change f1 to contain ints instead of floats. In that case I don't need to specify the values.
Expected Output
This is the output on Pandas 1.0.5 and 0.25.3:
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 2a7d332
python : 3.7.8.final.0
python-bits : 32
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : None.None
pandas : 1.1.2
numpy : 1.19.2
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.3
setuptools : 50.3.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.5.2
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.18.1
pandas_datareader: None
bs4 : 4.9.1
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.2
sqlalchemy : 1.3.18
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
None
The text was updated successfully, but these errors were encountered: