Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
df = pd.DataFrame({'species': ['mammal', 'mammal', 'fish'],
                   'population': [3948, 4000, 6000]},
                  index=['tiger', 'fox', 'shark'])
df
Out[2]:
species population
tiger mammal 3948
fox mammal 4000
shark fish 6000

Pandas: Dataframe - iteritems.

In [3]:
for label, content in df.items():
    print('label:', label)
    print('content:', content, sep='\n')
label: species
content:
tiger    mammal
fox      mammal
shark      fish
Name: species, dtype: object
label: population
content:
tiger    3948
fox      4000
shark    6000
Name: population, dtype: int64

Pandas: Dataframe - iteritems.