I have a python data frame.
ID status
5
from 4.3 to 5 yes
from 6 to 7.2 yes
6.3
6
I want to add another column col, as if status is missing then corresponding value is ID else substring(first integer in string) of ID
result should be like this
ID status col
5 5
from 4.3 to 5 yes 4.3
from 6 to 7.2 yes 6
6.3 6.3
6 6
sorry for very bad representation of the question.