You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rolling().skew modifies original data column. This is an unexpected and problematic behaviour since it does not occur with other rolling window methods like mean(), std() and `'kurt'. A coder would reasonably expect that these methods can be applied in the same way, therefore it is likely to cause issues that are hard to debug.
It can be worked around by using using copy, but again, this is a deviation from the usage of other similar methods: df['A'].copy().rolling(10).skew()
Uh oh!
There was an error while loading. Please reload this page.
[x ] 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.
Code Sample, a copy-pastable example
Apply skew to create new column and df['A'] is now modified unexpectedly
Problem description
rolling().skew
modifies original data column. This is an unexpected and problematic behaviour since it does not occur with other rolling window methods likemean()
,std()
and `'kurt'. A coder would reasonably expect that these methods can be applied in the same way, therefore it is likely to cause issues that are hard to debug.It can be worked around by using using copy, but again, this is a deviation from the usage of other similar methods:
df['A'].copy().rolling(10).skew()
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 3e89b4c
python : 3.8.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_Australia.1252
pandas : 1.2.0
numpy : 1.19.5
pytz : 2020.5
dateutil : 2.8.1
pip : 20.3.3
setuptools : 40.8.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.3
numexpr : 2.7.2
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.6.0
sqlalchemy : None
tables : 3.6.1
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: