how to write for loop on pandas dataframe