-
Notifications
You must be signed in to change notification settings - Fork 106
Open
Description
swifter.rolling passes "axis" as a kwarg to the Dask implementation of rolling. This appears to make swifter.rolling unusable, as the "axis" kwarg was deprecated with pandas>=2.1. (See the Dask docs.)
Even basic uses throw an error:
import pandas as pd
import swifter
df_pd = pd.DataFrame({"a": [0, 1, 2], "b": [0, 1, 2]})
print(df_pd.swifter.rolling(1))Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/anerdw/stackoverflow/stuff.py", line 6, in <module>
print(df_pd.swifter.rolling(1))
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anerdw/stackoverflow/env/lib/python3.11/site-packages/swifter/swifter.py", line 162, in rolling
return Rolling(
^^^^^^^^
File "/home/anerdw/stackoverflow/env/lib/python3.11/site-packages/swifter/swifter.py", line 737, in __init__
self._obj_dd = self._obj_dd.rolling(**{k: v for k, v in kwds.items() if k not in ["on", "closed"]})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anerdw/stackoverflow/env/lib/python3.11/site-packages/dask_expr/_collection.py", line 976, in rolling
return Rolling(self, window, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Rolling.__init__() got an unexpected keyword argument 'axis'
Metadata
Metadata
Assignees
Labels
No labels