-8

I need output for below input data using python 2.7

enter image description here

enter image description here

WhatsThePoint
  • 3,395
  • 8
  • 31
  • 53
Girish B
  • 3
  • 3
  • 1
    Please copy the code to your question in a [code snippet](https://stackoverflow.com/help/formatting). If the link of that image ever changes, the value of your question disappears. – Virginia Dec 21 '18 at 11:00
  • i have added script in image – Girish B Dec 21 '18 at 11:08

1 Answers1

0

This should work for you:

import re
your_string = "reth10.890"
number = re.findall("\d+\.\d+", your_string)
requested_string = re.sub(number[0], '', a)
print(requested_string)
>>>'reth'

If your string contains more floats you have to select the last one in number

dl.meteo
  • 1,658
  • 15
  • 25