Skip to content

Different precision calling .astype(str) on float numbers #11302

Closed
@marcomayer

Description

@marcomayer

With pandas 0.16.2:

import pandas as pd
pd.DataFrame([1.12345678901234567890]).astype(str)
0
0 1.12345678901

With pandas 0.17:

import pandas as pd
pd.DataFrame([1.12345678901234567890]).astype(str)
0
0 1.1234567890123457

I read the 0.17 release log but couldn't figure out why that is. Is it a bug or a new feature, and if it's a new feature how can I re-activate the old behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNumeric OperationsArithmetic, Comparison, and Logical operationsOutput-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