-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Closed
Labels
PDEP missing valuesIssues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprintIssues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint
Description
I like pd.Float64Dtype() and other pandas datatypes, but one small glitch found in below minimal case:
import pandas as pd
df = pd.DataFrame([(2, 1), (0, 0), (0, None)], columns=('a', 'b'))
df = df.astype(pd.Float64Dtype())
print(df['b'] / df['a'])
# 0 0.5
# 1 NaN
# 2 <NA>
# dtype: Float64
print((df['b'] / df['a']).fillna(0))
# 0 0.5
# 1 NaN
# 2 0.0
# dtype: Float64
print((df['b'] / df['a']).loc[1])
# np.float64(nan)Is there any plan to make fillna adapt to np.float64(np.nan)? Or make sure 0 / 0 in pd.Float64Dtype() can return pd.NA rather than np.float64(np.nan)?
Metadata
Metadata
Assignees
Labels
PDEP missing valuesIssues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprintIssues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint