I want to add a "+" to all positive values in my df.
Here is my df
import pandas as pd
import numpy as np
df = pd.DataFrame({'A':[-1,3,0,5],
'B':[4,5,6,5],
'C':[8,-9,np.nan,7]})
print (df)
A B C
0 -1 4 8.0
1 3 5 -9.0
2 0 6 NaN
3 5 5 7.0
This is what I want it to look like:
print (df)
A B C
0 -1 +4 +8.0
1 +3 +5 -9.0
2 +0 +6 NaN
3 +5 +5 +7.0
My attempt:
df[df > 0] = "+"
That just replaced the positive values with "+"