-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: another ValueError: buffer source array is read-only #37264
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
@dsaxton Here is an example: di=np.array(['2016-12-27 02:02:09', '2016-12-27 02:02:09.017000',
'2016-12-27 02:02:09.033000', '2016-12-27 02:02:09.050000',
'2016-12-27 02:02:09.066000'],dtype='datetime64[ns]')
di.setflags(write=False)
v1=[95.746, 95.735, 95.722, 95.709, np.nan]
v2=[-86.474, -86.491, -86.505, -86.513, np.nan]
temp=pd.DataFrame({'v1':v1,'v2':v2}, index=di)#res_df.index[0:5])
temp=temp.astype('float64')
temp2=temp.v1-temp.v2
temp2[temp2>180]=temp2[temp2>180]-360 |
I was have the same error when using the
Output:
|
I think it's related but the fix won't be identical, so probably warrants a separate issue. From some comments it looks like this might require at least Cython 3. |
Any movement on this? It's still marked as 'Needs Triage'? |
rank is already patched for master and 1.1.4 @dmitra79 can u try on master |
I just tried this on master (created clean environment, downloaded and buolt master) and got the same error:
|
I have checked that this issue has not already been reported.
[X ] 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.
This seems related to: #37174
however it shows up under different conditions - appears to be triggered by comparison involving NaN.
Code Sample, a copy-pastable example
Output:
Problem description
See error above
Expected Output
I would have expected:
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : db08276
python : 3.8.6.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-118-generic
Version : #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.3
numpy : 1.19.2
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.3
setuptools : 49.6.0.post20201009
Cython : 0.29.21
lxml.etree : 4.5.2
jinja2 : 2.11.2
IPython : 7.18.1
fsspec : 0.8.4
fastparquet : 0.4.1
matplotlib : 3.3.2
pyarrow : 0.17.1
scipy : 1.5.2
xarray : 0.16.1
numba : 0.51.2
The text was updated successfully, but these errors were encountered: