I have a DataFrame object of dtype string. A typical row looks like below:
'\n\n Dividend Indicated Gross Yield\n \n\n 1.50%\n \n'
I am trying to extract only the numerical data from the above string. for example, my desired output should be 1.50
.
The other thing to keep in mind is that each row will have different length of numericals and some may include a negative sign too.
I have tried some recommendations involving .rstrip()
, regex
, convert_objects
but they do not work as intended. Any help appreciated.
You probably want to do this: