Skip to content

What about negative numbers expressed as (1,000.00) #9

@myanalysis

Description

@myanalysis

really like the number funcation a lot since i am using regex and getting a lot of funny data for numbers.
but what about when they express a negative with () instead of a negative symbol?
this does regex does not always work on data and cleaning with your parseNumber would be a great combo.

df = df.replace('[\$,)]', '', regex=True).replace('[(]', '-', regex=True).astype(float)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions