I need to print each row in a data frame. I used iterrow() to print, but the rows printed were tuples. I want to retain each row a dataframe
please refer to the below code
def rowprint(df):
if len(df):
for row in iterrows():
print(row['col1'])
if __name__ == '__main__':
df= df.loc[df['col3']=='value']
rowprint(df)
error: tuple indices must be integers or slices, not str