import pandas as pd # Create a sample DataFrame df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]}) # Iterate over the rows of the DataFrame for index, row in df.iterrows(): # Access data for each column by column name print(row['A'], row['B'])
Learn Flask development and learn to build cool apps with our premium Python course on Udemy.