Pandas > Iterate over columns

Name
Code
Output
dataframe = pandas.DataFrame(numpy.random.randint(0,100,size=(3, 2)), columns=['C1','C2'])
print ("dataframe")
print (dataframe)
print (10*'-')
print ("Iteration \n")
for col_idx,data in dataframe.iteritems():
    print ("column:",col_idx)
    print ("column data:")
    print (data,"\n")
dataframe
   C1  C2
0  63  20
1  25  47
2  60  65
----------
Iteration 

column: C1
column data:
0    63
1    25
2    60
Name: C1, dtype: int64 

column: C2
column data:
0    20
1    47
2    65
Name: C2, dtype: int64