I have column in my dataframe which is having string value as shown in fig 1.
What i wanted to do is to replace all nan value from 0 and other with 1 (whatever another field is like string and int) I tried this
func_lambda = lambda x: 1 if any(dataframe['Colum'].values != 0) else 0
But t is replacing all the column with 1.
this is my df.head
datacol.head(20)
Out[77]:
0 nan
1 4500856427
2 4003363
3 nan
4 16-4989
5 nan
6 nan
7 WVE-78686557032
8 nan
9 4501581113
10 D4-SC-0232737-1/G1023716
11 nan
12 nan
13 4502549104
14 nan
15 nan
16 nan
17 IT008297
18 15\036628
19 299011667
Name: Customer_PO_Number, dtype: object