for name, values in df.iteritems():
print('{name}: {value}'.format(name=name, value=values[0]))
for x in whatever_df["Whatever Column Name"]:
print(x)
for column in df:
print(df[column])
for column_name in df.columns.values:
print(column_name)
# importing pandas as pd
import pandas as pd
# dictionary of lists
dict = {'name':["aparna", "pankaj", "sudhir", "Geeku"],
'degree': ["MBA", "BCA", "M.Tech", "MBA"],
'score':[90, 40, 80, 98]}
# creating a dataframe from a dictionary
df = pd.DataFrame(dict)
# iterating over rows using iterrows() function
for i, j in df.iterrows():
print(i, j)
print()