Question: How to .apply(lambda x: x.split()) on a partial dataframe
I am trying to replace this kind of answer in my data frame : case_1 case_2 case_3
by : [case_1,case_2,case_3]
.apply(lambda x: x.split()) seems to be a good way to do it
But I also have some Nan value in the dataframe that raise this error :
Does somebody have an idea how should I proceed ? Maybe how to apply the function on the python error dataframe only if it has been answered ?
r_bt.res_enquete_poteaux['type_anomalie'].apply(lambda x: x.split() if x!=np.nan) ^ SyntaxError: invalid syntax
9codings