Prac 4
Prac 4
# Creating a separate column for the target variable of the iris dataset
data['Species'] = iris.target
# Replacing the categories of the target variable with the actual names of the
species
target = np.unique(iris.target)
target_n = np.unique(iris.target_names)
target_dict = dict(zip(target, target_n))
data['Species'] = data['Species'].replace(target_dict)