I am struggling with mixed data type provided to me in Excel by my team members. The column contains text, whole number and decimals. This is pandas dataframe and contains more columns too. Below is the example.
Column |
---|
Does not apply |
2 |
5 |
0.07 |
0.45 |
7% offset |
I want to create a logic where if a row is whole number then add $ sign before it. If a row is less than 1 then multiply it by 100 and add %, if a cell has digits then also multiply by 100 and add %, and else if it has text then do nothing. I tried a solution which kind of helped writing the basic regular expression to grab the positive integers but it does not work completely.
This is how it should look like.
Column |
---|
Does not apply |
$2 |
$5 |
70% |
45% |
7% offset |
Additional Comment I apologize but I had to add another logic here. If the cell contains text anywhere either in the beginning or middle then do nothing.