Skip to content

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

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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