In [1]:
import pandas as pd
import numpy as np
from sklearn.datasets import load_iris
iris = load_iris()

data = pd.DataFrame(data= np.c_[iris['data'], iris['target']],
                     columns= iris['feature_names'] + ['target'])
In [2]:
head(data)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-f68d2b2478e8> in <module>()
----> 1 head(data)

NameError: name 'head' is not defined
In [3]:
data.head()
Out[3]:
sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) target
0 5.1 3.5 1.4 0.2 0.0
1 4.9 3.0 1.4 0.2 0.0
2 4.7 3.2 1.3 0.2 0.0
3 4.6 3.1 1.5 0.2 0.0
4 5.0 3.6 1.4 0.2 0.0
In [ ]: