-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
BugMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arraysTransformationse.g. cumsum, diff, ranke.g. cumsum, diff, rank
Description
# Based on test_rank_ea_small_values
import pandas as pd
ser = pd.Series(
[5.4954145e29, -9.791984e-21, 9.3715776e-26, pd.NA, 1.8790257e-28],
dtype="Float64",
)
ser2 = ser.astype(object)
>>> ser.rank(method="min")
0 4.0
1 1.0
2 3.0
3 NaN
4 2.0
dtype: float64
>>> ser2.rank(method="min")
0 4.0
1 1.0
2 1.0
3 NaN
4 1.0
dtype: float64
I'd expect 1) the values to match and 2) to get NA rather than NaN at least for the Float64 case.
Update: if we convert to float64[pyarrow] first we do get NA back and a uint64[pyarrow] dtype.
Metadata
Metadata
Assignees
Labels
BugMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNA - MaskedArraysRelated to pd.NA and nullable extension arraysRelated to pd.NA and nullable extension arraysTransformationse.g. cumsum, diff, ranke.g. cumsum, diff, rank