-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: groupby-nunique modifies null values #31950
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
Labels
Milestone
Comments
Thanks @thomas-reineking-jdas |
I think this was caused by #27951. Seems the values get mutated here: https://github.com/pandas-dev/pandas/blob/master/pandas/core/groupby/generic.py#L596 |
@dsaxton yes, seems that you're right |
I think the problem might stem from this:
Can push a fix which removes
but it might require pushing the minimum numpy version up, looking into it |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample, a copy-pastable example if possible
Problem description
Original dataframe is modified:
Issue seems to have been introduced in version 1.0.0, 0.25.3 works as expected.
Expected Output
Original dataframe should not be modified.
Output of
pd.show_versions()
pandas : 1.0.1
numpy : 1.17.2
pytz : 2019.3
dateutil : 2.8.1
pip : 19.2.3
setuptools : 41.2.0
Cython : 0.29.13
pytest : 5.2.1
hypothesis : 4.23.0
sphinx : 1.7.9
blosc : None
feather : None
xlsxwriter : 1.2.2
lxml.etree : 4.4.1
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.8.2 (dt dec pq3 ext lo64)
jinja2 : 2.10.3
IPython : 7.9.0
pandas_datareader: None
bs4 : None
bottleneck : 1.2.1
fastparquet : None
gcsfs : None
lxml.etree : 4.4.1
matplotlib : 3.1.1
numexpr : 2.7.0
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.13.0
pytables : None
pytest : 5.2.1
pyxlsb : None
s3fs : None
scipy : 1.2.1
sqlalchemy : 1.3.11
tables : None
tabulate : 0.8.5
xarray : None
xlrd : None
xlwt : None
xlsxwriter : 1.2.2
numba : 0.45.1
The text was updated successfully, but these errors were encountered: