I have df like:
CELLID lon lat METER LATITUDE_SM LONGITUDE_SM Path_ID
2557709 5.286339 51.353820 E0047000004028217 51.3501 5.3125 2557709_E0047000004028217
For each Path_ID(str) I would like to iterate the loop and would like to achieve df1 like:
Path_ID METER LATITUDE_SM LONGITUDE_SM
2557709_E0047000004028217 E0047000004028217 51.3501 5.3125
Path_ID CELLID Lon lat
2557709_E0047000004028217 2557709 5.286339 51.353820
I have many rows in the df. I am doing something like
for row in df.iterrows():
print row ['Path_ID'],row['METER'],row['LATITUDE_SM'], row ['LONGITUDE_SM']
dfwhy are you using a loop to print it out? Doesprint(df)not suffice?print(df[['Path_ID', 'CEILID', 'Lon', 'lat']])for instance