import pandas as pd
df = pd.DataFrame({'col1': [1, 2, 3], 'col2': [2, 3, 4]})
for i=0 to range(len(df))
print(df.iloc[i]['col1'] + '-' + df.iloc[i]['col2'])
I want to use: (but it is giving me error)
for d in df:
print(d['col1'] + '-' + d['col2'])
# I want output
# 2-3
# 3-4
Simple Pandas question only...