-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DataFrame.groupby.apply returns different results with copy lambda functions. #14927
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
so these are examples where things seem to be mutated, the only detection is that the reference changed. This is an implementation detail; we have had a couple of reports very similiar to this. #14810 (and some others, but this is hard to search for actually). If you want to try to figure out how to make this better, by all means. |
I think we should try to deprecate this behaviour of trying to detect whether the original object is mutated (and then do a transform like operation) before 1.0 |
I'm still encountering this issue of inconsistent return formats with pandas 1.4.4 and 1.5 e.g with this code the results are inconsistent and I don't understand why |
Code Sample, a copy-pastable example if possible
Problem description
xref #9867
Issue #9946 (In[36]) no longer raises a
ValueError
on master 0.19.1, but I am curious why these 4 cases return 2 different results.Expected Output
Not sure since I don't have a personal use-case for this operation, but I'd expect these operations to return the same result unless I am missing something with using a deepcopy.
Output of
pd.show_versions()
commit: 3ccb501
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-45-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None
pandas: 0.19.0+228.g3ccb501
nose: 1.3.7
pip: 8.1.2
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.2
scipy: None
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: 1.4.8
patsy: None
dateutil: 2.5.3
pytz: 2016.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
s3fs: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: