-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Arrowpyarrow functionalitypyarrow functionalityBugClosing CandidateMay be closeable, needs more eyeballsMay be closeable, needs more eyeballsGroupby
Description
Pandas version checks
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import pandas as pd
import numpy as np
pd.options.mode.dtype_backend = 'pyarrow'
df = pd.DataFrame({
'tags': pd.Series([1,1,1,2,2,2,3,3,3,4,4,4,5,5,5],dtype='int64[pyarrow]'),
'value': pd.Series(np.random.rand(15),dtype='double[pyarrow]')
})
result = df['value'].rank()
result = df.groupby('tags')['value'].rank()
Issue Description
When grouping a dataframe and applying the rank
function on a column with data type double[pyarrow]
I get the following error:
TypeError: rank is not supported for double[pyarrow] dtype
However, applying the rank function without groupby
works. This leads me to believe that the error message is misleading and that in fact the rank
function does support data type double[pyarrow]
.
Expected Behavior
The rank
function works in combination with groupby
for data type double[pyarrow]
.
Installed Versions
Replace this line with the output of pd.show_versions()
Metadata
Metadata
Assignees
Labels
Arrowpyarrow functionalitypyarrow functionalityBugClosing CandidateMay be closeable, needs more eyeballsMay be closeable, needs more eyeballsGroupby