[DOC] `.mode()` incorrectly states that axis=1 is supported as it throws "NotImplementedError" when you try
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
## Report incorrect documentation
**Location of incorrect documentation**
https://docs.rapids.ai/api/cudf/stable/api_docs/api/cudf.DataFrame.mode.html?highlight=mode#cudf.DataFrame.mode
**Describe the problems or issues found in the documentation**
Documentation says that mode can be applied over columns (axis = 0) or rows (axis = 1), but when trying axis = 1, it says `Only axis=0 is currently supported`
**Steps taken to verify documentation is incorrect**
```
import cudf
df = cudf.DataFrame(np.random.randint(0,5,size=(15, 10)), columns=list('ABCDEFGHIJ'))
df.mode(axis=1)
```
Stack trace
```
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
/tmp/ipykernel_2243/3323872345.py in
----> 1 df.mode(axis=1)
/opt/conda/envs/rapids/lib/python3.8/contextlib.py in inner(*args, **kwds)
73 def inner(*args, **kwds):
74 with self._recreate_cm():
---> 75 return func(*args, **kwds)
76 return inner
77
/opt/conda/envs/rapids/lib/python3.8/site-packages/cudf/core/dataframe.py in mode(self, axis, numeric_only, dropna)
5678 """
5679 if axis not in (0, "index"):
-> 5680 raise NotImplementedError("Only axis=0 is currently supported")
5681
5682 if numeric_only:
NotImplementedError: Only axis=0 is currently supported
```
**Suggested fix for documentation**
Either
1. state that axis = 1 is not supported
2. remove references for axis = 1 in docs
3. add the functionality
Contributor guide
Assessment
This issue has not been assessed yet.