Iterating through Pandas Column and replacing nan values
You can use isnull()
in something like:
df.loc[pd.isnull(df['A']), 'A'] = mylist
Example:
In [19]: dfOut[19]: A B C0 7.2 b woo1 NaN v sal2 NaN o sdd3 8.1 k triliIn [20]: mylist = [3.2, 1.1]In [21]: df.loc[pd.isnull(df['A']), 'A'] = mylistIn [22]: dfOut[22]: A B C0 7.2 b woo1 3.2 v sal2 1.1 o sdd3 8.1 k trili