hi I have a dataframe like this, I want to replace negtive values with 0, but at the same time keep Nan values. The below code doesn't work because df['Data']<0 can't supported between instances of 'str' and 'int'. Any simple suggetions?
df[(df['Data'].notnull())& (df['Data']<0)]
Data
0 1
1 0.5
2 0
3 -0.5
4 -1
5 Nan
6 Nan
wanted result
Data
0 1
1 0.5
2 0
3 0
4 0
5 Nan
6 Nan