# Method A for single column dataframe
cell = list()
for i in range(len(df)):
cell_value=df.iloc[i][0]
cell.append(cell_value)
# Method B for multiple column dataframe
for index, row in df.iterrows():
print(row["c1"], row["c2"])
# Method C
columns = list(df.columns)
for i in columns:
print (df[i][2])
import pandas as pd
df = pd.DataFrame({'c1': [10, 11, 12], 'c2': [100, 110, 120]})
df = df.reset_index() # make sure indexes pair with number of rows
for index, row in df.iterrows():
print(row['c1'], row['c2'])