-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: A read-only DataFrame cannot be .diff()'ed #35559
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
@WillAyd could use your help here. The solution should be to go into algos.pyx and change the first argument in With the first variant, I get a cython compile-time exception that I think is because fused types dont support const (maybe in the upcoming cython release? not sure off the top of my head) With the ndarray variant, I get clang-compile-time errors:
(Note: the ndarray version also requires changing Thoughts on how to handle this? |
Hmm yea both of those are unfortunate. I do wonder to your point if we can get Cython 3.0 to work with the const declaration, as that would be the cleanest |
(this is a regression compared to 1.0, so tagging for 1.1.1) |
regression in #31935
see https://github.com/pandas-dev/pandas/pull/31935/files#r378496858 |
So live with the clang warnings for now? (I don't think that cython 3 is an option for 1.1.1) |
@WillAyd Are there build flags we can change in setup.py that will turn these from clang errors into clang warnings? |
Yea you can just use Line 458 in 3701a9b
Though if you can create an MRE it's worth reporting upstream. Cython does consider dead code generation to be a bug but doesn't explicitly test for it yet |
Is upstream in this case cython or somewhere else? |
Yea this would be a Cython issue |
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.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
df.diff()
does not seem like a data-mutating operation, at least not to me. My read is thatdf.iloc[]
was given the same assessment in 2015 (#10043).Expected Output
Output of
pd.show_versions()
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200714
Cython : None
pytest : 6.0.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : 2.8.5 (dt dec pq3 ext lo64)
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : 4.9.1
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : 1.3.18
tables : None
tabulate : 0.8.3
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: