Answers for "pandas convert numbers in parentheses to negative"

0

pandas convert numbers in parentheses to negative

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

   Currency
0         1
1      2000
2     -3000
Posted by: Guest on March-23-2021

Code answers related to "pandas convert numbers in parentheses to negative"

Python Answers by Framework

Browse Popular Code Answers by Language