from sklearn import datasets
import pandas as pd
raw_data = datasets.load_iris()
# Load iris dataset
iris_df = pd.DataFrame(raw_data.data)
iris_df['class'] = raw_data.target.astype('str')
iris_df.columns=['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'class']
iris_df
Run to view results
Run to view results