-
- Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
Milestone
Description
Code Sample, a copy-pastable example if possible
>>> arr = np.array([1, 3, np.nan, 3, 5]) >>> arr.setflags(write=False) >>> pd.Series(arr).rolling(2).mean().values --------------------------------------------------------------------------- ValueError: assignment destination is read-onlyExpected Output
>>> pd.Series(arr).rolling(2).mean().values array([nan, 2., nan, nan, 4.])Problem description
#27391 (comment) missed a copy call before writing into array, which is user's data and which may be read-only.
Output of pd.show_versions()
pandas 0.25.0