You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a groupby operation followed by an nunique operation, nans are converted to non-nan float values. According to the documentation, the nunique function should return a series but should not update the original dataframe. Also according to the documentation you can ignore nans, however this seems to still change the value nans to a non-nan number.
This does not happen if nunique is applied without the groupby function.
Expected Output
The expected output is that nan values should not be converted to any other value based on an aggregrate operation on the dataframe.
Output of pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.6.10.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-45-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
Code Sample, a copy-pastable example if possible
Problem description
When a
groupby
operation followed by annunique
operation, nans are converted to non-nan float values. According to the documentation, thenunique
function should return a series but should not update the original dataframe. Also according to the documentation you can ignore nans, however this seems to still change the value nans to a non-nan number.This does not happen if
nunique
is applied without thegroupby
function.Expected Output
The expected output is that nan values should not be converted to any other value based on an aggregrate operation on the dataframe.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.6.10.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-45-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.1
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 20.0.2
setuptools : 45.2.0.post20200210
Cython : 0.29.15
pytest : 5.3.5
hypothesis : 5.4.1
sphinx : 2.4.0
blosc : None
feather : None
xlsxwriter : 1.2.7
lxml.etree : 4.5.0
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.1
IPython : 7.12.0
pandas_datareader: None
bs4 : 4.8.2
bottleneck : 1.3.1
fastparquet : None
gcsfs : None
lxml.etree : 4.5.0
matplotlib : 3.1.3
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : None
pytables : None
pytest : 5.3.5
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : 1.3.13
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.2.7
numba : 0.48.0
The text was updated successfully, but these errors were encountered: