{ "cells": [ { "cell_type": "markdown", "source": [ "# 🍄 Mushroom Proportions" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "Import the mushroom dataset" ], "metadata": {} }, { "cell_type": "code", "execution_count": 4, "source": [ "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "mushrooms = pd.read_csv('../../../data/mushrooms.csv')\n", "mushrooms.head()" ], "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " class cap-shape cap-surface cap-color bruises odor \\\n", "0 Poisonous Convex Smooth Brown Bruises Pungent \n", "1 Edible Convex Smooth Yellow Bruises Almond \n", "2 Edible Bell Smooth White Bruises Anise \n", "3 Poisonous Convex Scaly White Bruises Pungent \n", "4 Edible Convex Smooth Green No Bruises None \n", "\n", " gill-attachment gill-spacing gill-size gill-color ... \\\n", "0 Free Close Narrow Black ... \n", "1 Free Close Broad Black ... \n", "2 Free Close Broad Brown ... \n", "3 Free Close Narrow Brown ... \n", "4 Free Crowded Broad Black ... \n", "\n", " stalk-surface-below-ring stalk-color-above-ring stalk-color-below-ring \\\n", "0 Smooth White White \n", "1 Smooth White White \n", "2 Smooth White White \n", "3 Smooth White White \n", "4 Smooth White White \n", "\n", " veil-type veil-color ring-number ring-type spore-print-color population \\\n", "0 Partial White One Pendant Black Scattered \n", "1 Partial White One Pendant Brown Numerous \n", "2 Partial White One Pendant Brown Numerous \n", "3 Partial White One Pendant Black Scattered \n", "4 Partial White One Evanescent Brown Abundant \n", "\n", " habitat \n", "0 Urban \n", "1 Grasses \n", "2 Meadows \n", "3 Urban \n", "4 Grasses \n", "\n", "[5 rows x 23 columns]" ], "text/html": [ "
\n", " | class | \n", "cap-shape | \n", "cap-surface | \n", "cap-color | \n", "bruises | \n", "odor | \n", "gill-attachment | \n", "gill-spacing | \n", "gill-size | \n", "gill-color | \n", "... | \n", "stalk-surface-below-ring | \n", "stalk-color-above-ring | \n", "stalk-color-below-ring | \n", "veil-type | \n", "veil-color | \n", "ring-number | \n", "ring-type | \n", "spore-print-color | \n", "population | \n", "habitat | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "Poisonous | \n", "Convex | \n", "Smooth | \n", "Brown | \n", "Bruises | \n", "Pungent | \n", "Free | \n", "Close | \n", "Narrow | \n", "Black | \n", "... | \n", "Smooth | \n", "White | \n", "White | \n", "Partial | \n", "White | \n", "One | \n", "Pendant | \n", "Black | \n", "Scattered | \n", "Urban | \n", "
1 | \n", "Edible | \n", "Convex | \n", "Smooth | \n", "Yellow | \n", "Bruises | \n", "Almond | \n", "Free | \n", "Close | \n", "Broad | \n", "Black | \n", "... | \n", "Smooth | \n", "White | \n", "White | \n", "Partial | \n", "White | \n", "One | \n", "Pendant | \n", "Brown | \n", "Numerous | \n", "Grasses | \n", "
2 | \n", "Edible | \n", "Bell | \n", "Smooth | \n", "White | \n", "Bruises | \n", "Anise | \n", "Free | \n", "Close | \n", "Broad | \n", "Brown | \n", "... | \n", "Smooth | \n", "White | \n", "White | \n", "Partial | \n", "White | \n", "One | \n", "Pendant | \n", "Brown | \n", "Numerous | \n", "Meadows | \n", "
3 | \n", "Poisonous | \n", "Convex | \n", "Scaly | \n", "White | \n", "Bruises | \n", "Pungent | \n", "Free | \n", "Close | \n", "Narrow | \n", "Brown | \n", "... | \n", "Smooth | \n", "White | \n", "White | \n", "Partial | \n", "White | \n", "One | \n", "Pendant | \n", "Black | \n", "Scattered | \n", "Urban | \n", "
4 | \n", "Edible | \n", "Convex | \n", "Smooth | \n", "Green | \n", "No Bruises | \n", "None | \n", "Free | \n", "Crowded | \n", "Broad | \n", "Black | \n", "... | \n", "Smooth | \n", "White | \n", "White | \n", "Partial | \n", "White | \n", "One | \n", "Evanescent | \n", "Brown | \n", "Abundant | \n", "Grasses | \n", "
5 rows × 23 columns
\n", "\n", " | cap-shape | \n", "cap-surface | \n", "cap-color | \n", "bruises | \n", "odor | \n", "gill-attachment | \n", "gill-spacing | \n", "gill-size | \n", "gill-color | \n", "stalk-shape | \n", "... | \n", "stalk-surface-below-ring | \n", "stalk-color-above-ring | \n", "stalk-color-below-ring | \n", "veil-type | \n", "veil-color | \n", "ring-number | \n", "ring-type | \n", "spore-print-color | \n", "population | \n", "habitat | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
class | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
Edible | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "... | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "4208 | \n", "
Poisonous | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "... | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "3916 | \n", "
2 rows × 22 columns
\n", "\n", " | class | \n", "cap-shape | \n", "cap-surface | \n", "bruises | \n", "odor | \n", "gill-attachment | \n", "gill-spacing | \n", "gill-size | \n", "gill-color | \n", "stalk-shape | \n", "... | \n", "stalk-surface-below-ring | \n", "stalk-color-above-ring | \n", "stalk-color-below-ring | \n", "veil-type | \n", "veil-color | \n", "ring-number | \n", "ring-type | \n", "spore-print-color | \n", "population | \n", "habitat | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cap-color | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
Brown | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "... | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "2284 | \n", "
Buff | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "... | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "168 | \n", "
Cinnamon | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "... | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "44 | \n", "
Green | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "... | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "1856 | \n", "
Pink | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "... | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "144 | \n", "
Purple | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "... | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "16 | \n", "
Red | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "... | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "1500 | \n", "
White | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "... | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "1040 | \n", "
Yellow | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "... | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "1072 | \n", "
9 rows × 22 columns
\n", "\n", " | class | \n", "cap-shape | \n", "cap-surface | \n", "cap-color | \n", "bruises | \n", "odor | \n", "gill-attachment | \n", "gill-spacing | \n", "gill-size | \n", "gill-color | \n", "... | \n", "stalk-surface-above-ring | \n", "stalk-surface-below-ring | \n", "stalk-color-above-ring | \n", "stalk-color-below-ring | \n", "veil-type | \n", "veil-color | \n", "ring-number | \n", "ring-type | \n", "spore-print-color | \n", "population | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
habitat | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
Grasses | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "... | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "2148 | \n", "
Leaves | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "... | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "832 | \n", "
Meadows | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "... | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "292 | \n", "
Paths | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "... | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "1144 | \n", "
Urban | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "... | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "368 | \n", "
Waste | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "... | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "192 | \n", "
Wood | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "... | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "3148 | \n", "
7 rows × 22 columns
\n", "