NVIDIA / NVIDIA/cudf

[BUG] Discrepancy between cudf and pandas for cumulative operations

Open
#15,176 0 comments 0 reactions 0 assignees View on GitHub
bug Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**
For cumulative operations (e.g. `cummax`, `cummin`, `cumsum`, `cumprod`), Pandas defines `axis` and `skipna` as optional positional arguments, while cudf requires these to be key-word arguments.

**Steps/Code to reproduce bug**
```python
import cudf
import pandas as pd

df = pd.DataFrame({"a": [1, 2]})
axis = 0
skipna = False
df.cumsum(axis, skipna)
```
```
a
0 1
1 3
```
```python
cudf.from_pandas(df).cumsum(axis, skipna)
```
```
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[34], line 7
5 axis = 0
6 skipna = False
----> 7 cudf.from_pandas(df).cumsum(axis, skipna)

File /.../site-packages/cudf/core/mixins/mixin_factory.py:11, in _partialmethod..wrapper(self, *args2, **kwargs2)
10 def wrapper(self, *args2, **kwargs2):
---> 11 return method(self, *args1, *args2, **kwargs1, **kwargs2)

File /.../site-packages/nvtx/nvtx.py:115, in annotate.__call__..inner(*args, **kwargs)
112 @wraps(func)
113 def inner(*args, **kwargs):
114 libnvtx_push_range(self.attributes, self.domain.handle)
--> 115 result = func(*args, **kwargs)
116 libnvtx_pop_range(self.domain.handle)
117 return result

TypeError: DataFrame._scan() got multiple values for argument 'op'
```

**Expected behavior**
I'd expect cudf behavior to be consistent with pandas in this case.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.