I know this question has been asked many times but I have tried almost all methods I am trying to iterate over rows in DataFrame using following code.
import pandas as pd
df = pd.read_csv(r"file.csv")
for row in df:
print(row)
there is only one column in csv file and it only prints header of file. I have also used .items() , .iterrows() and .itertuples(), all these methods give tuples as output which I don't need. Further task I am trying to do in loop only accepts output from for row in df:. kindly help that how can I print actual rows this way rather than just header name. Thank you.
for row in df[col_name].to_list():for _, row in df.iterrows()