1

I have a dataframe

value 
5
5.67E+54
10
1.04E+26

My expected output is

value 
5
10000
10
10000

I would like to detect exponential value in a dataframe and replace with 10000. Thanks!

nerd
  • 473
  • 5
  • 15
  • 1
    Does this answer your question? [pandas applying regex to replace values](https://stackoverflow.com/questions/22588316/pandas-applying-regex-to-replace-values) – Henry Woody Dec 09 '22 at 02:57
  • 1
    `df['value'] = df['value'].str.replace(r'.*E\+.*', '10000', regex=True).astype(int)` – tdy Dec 09 '22 at 03:00

0 Answers0