I am trying to use the following code to set a new column, wdf['Thunder'] to the value of wdf['RngT] if the word Thunderstorm is in the column wdf['Notes']. However, I keep getting the error TypeError: argument of type 'float' is not iterable. None of the columns are floats. RngT is an int, Notes is an object. Full code is:
wdf['Thunder'] = [wdf['RngT'] if 'Thunderstorm' in x else 0 for x in wdf['Notes']]
New to pandas, so would appreciate any insight.
Thanks!