Skip to content

BUG: numpy_nullable NaNs do not round-trip through CSV #61617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
jbrockmendel opened this issue Jun 9, 2025 · 0 comments
Open
3 tasks done

BUG: numpy_nullable NaNs do not round-trip through CSV #61617

jbrockmendel opened this issue Jun 9, 2025 · 0 comments
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member PDEP missing values Issues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint

Comments

@jbrockmendel
Copy link
Member

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

arr = pd.array([0, pd.NA])
ser = pd.Series(arr) / 0
ser[2] = 3
df = ser.to_frame("A")

text = df.to_csv()

rt = pd.read_csv(StringIO(text), dtype_backend="numpy_nullable")[["A"]]

>>> df.loc[0, "A"]
np.float64(nan)
>>> rt.loc[0, "A"]
<NA>

Issue Description

This is a consequence of the constructor casting NaNs to pd.NA, xref #32265

Expected Behavior

NA

Installed Versions

Replace this line with the output of pd.show_versions()

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member PDEP missing values Issues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint labels Jun 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member PDEP missing values Issues that would be addressed by the Ice Cream Agreement from the Aug 2023 sprint
Projects
None yet
Development

No branches or pull requests

1 participant