Solution 5.1
Perform the following steps to complete the activity:
- For this activity, all you will need is the
pandas
library. Load it in the first cell of the notebook:import pandas as pd
- Read in the
mushroom.csv
data from theDatasets
directory and list the first five rows using.head()
:mushroom = pd.read_csv('../Datasets/mushroom.csv') mushroom.head()
This produces the following output:
Note
Please change the path of the dataset file (highlighted) based on where you have downloaded it on your system.
- You see the
class
column and many visible attributes. List out all the columns to see what else there is to work with:mushroom.columns
This produces the following output:
- In addition to
class
, you seepopulation
andhabitat
, which are not visible attributes. You decide to create a multi...