I have the following indexed DataFrame with named columns and rows not- continuous numbers:
a b c d 2 0.671399 0.101208 -
Easiest ways:-
data['new_col'] = list_of_values data.loc[ : , 'new_col'] = list_of_values
This way you avoid what is called chained indexing when setting new values in a pandas object. Click here to read further.