Skip to content

BUG: Nullable floats can look like ints in repr #36775

Closed
@dsaxton

Description

@dsaxton

Nullable floats when output to the screen can look like ints, but in my opinion should look the same as regular non-NaN floats so as not to cause confusion.

import pandas as pd

s = pd.Series([0.0, 1.0, None], dtype="Float64")
print(s)
# 0       0
# 1       1
# 2    <NA>
# dtype: Float64
print(s.astype(float))
# 0    0.0
# 1    1.0
# 2    NaN
# dtype: float64
pd.__version__
# '1.2.0.dev0+560.g86f543143'

cc @jorisvandenbossche

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNA - MaskedArraysRelated to pd.NA and nullable extension arraysOutput-Formatting__repr__ of pandas objects, to_string

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions