diff --git a/Honey_nut_clusters.ipynb b/Honey_nut_clusters.ipynb
new file mode 100644
index 0000000..e4a017b
--- /dev/null
+++ b/Honey_nut_clusters.ipynb
@@ -0,0 +1,3538 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 46,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import pandas as pd\n",
+ "import numpy as np\n",
+ "from sklearn.cluster import KMeans\n",
+ "from sklearn import preprocessing\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 47,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "df = pd.DataFrame.from_csv('cereals.csv')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 48,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "df_nan = df.replace(to_replace=-1, value=np.nan)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 49,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " mfr | \n",
+ " type | \n",
+ " calories | \n",
+ " protein | \n",
+ " fat | \n",
+ " sodium | \n",
+ " fiber | \n",
+ " carbo | \n",
+ " sugars | \n",
+ " potass | \n",
+ " vitamins | \n",
+ " shelf | \n",
+ " weight | \n",
+ " cups | \n",
+ "
\n",
+ " \n",
+ " name | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 100%_Bran | \n",
+ " N | \n",
+ " C | \n",
+ " 70 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 130 | \n",
+ " 10 | \n",
+ " 5 | \n",
+ " 6 | \n",
+ " 280 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.33 | \n",
+ "
\n",
+ " \n",
+ " 100%_Natural_Bran | \n",
+ " Q | \n",
+ " C | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 5 | \n",
+ " 15 | \n",
+ " 2 | \n",
+ " 8 | \n",
+ " 8 | \n",
+ " 135 | \n",
+ " 0 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " All-Bran | \n",
+ " K | \n",
+ " C | \n",
+ " 70 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 260 | \n",
+ " 9 | \n",
+ " 7 | \n",
+ " 5 | \n",
+ " 320 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.33 | \n",
+ "
\n",
+ " \n",
+ " All-Bran_with_Extra_Fiber | \n",
+ " K | \n",
+ " C | \n",
+ " 50 | \n",
+ " 4 | \n",
+ " 0 | \n",
+ " 140 | \n",
+ " 14 | \n",
+ " 8 | \n",
+ " 0 | \n",
+ " 330 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Almond_Delight | \n",
+ " R | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 200 | \n",
+ " 1 | \n",
+ " 14 | \n",
+ " 8 | \n",
+ " NaN | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " mfr type calories protein fat sodium fiber \\\n",
+ "name \n",
+ "100%_Bran N C 70 4 1 130 10 \n",
+ "100%_Natural_Bran Q C 120 3 5 15 2 \n",
+ "All-Bran K C 70 4 1 260 9 \n",
+ "All-Bran_with_Extra_Fiber K C 50 4 0 140 14 \n",
+ "Almond_Delight R C 110 2 2 200 1 \n",
+ "\n",
+ " carbo sugars potass vitamins shelf weight \\\n",
+ "name \n",
+ "100%_Bran 5 6 280 25 3 1 \n",
+ "100%_Natural_Bran 8 8 135 0 3 1 \n",
+ "All-Bran 7 5 320 25 3 1 \n",
+ "All-Bran_with_Extra_Fiber 8 0 330 25 3 1 \n",
+ "Almond_Delight 14 8 NaN 25 3 1 \n",
+ "\n",
+ " cups \n",
+ "name \n",
+ "100%_Bran 0.33 \n",
+ "100%_Natural_Bran 1.00 \n",
+ "All-Bran 0.33 \n",
+ "All-Bran_with_Extra_Fiber 0.50 \n",
+ "Almond_Delight 0.75 "
+ ]
+ },
+ "execution_count": 49,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_nan.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 50,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "calories 106.883117\n",
+ "protein 2.545455\n",
+ "fat 1.012987\n",
+ "sodium 159.675325\n",
+ "fiber 2.151948\n",
+ "carbo 14.802632\n",
+ "sugars 7.026316\n",
+ "potass 98.666667\n",
+ "vitamins 28.246753\n",
+ "shelf 2.207792\n",
+ "weight 1.029610\n",
+ "cups 0.821039\n",
+ "dtype: float64"
+ ]
+ },
+ "execution_count": 50,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "df_nan.mean()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 51,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "filled_in_df = df_nan.fillna(df_nan.mean())"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " mfr | \n",
+ " type | \n",
+ " calories | \n",
+ " protein | \n",
+ " fat | \n",
+ " sodium | \n",
+ " fiber | \n",
+ " carbo | \n",
+ " sugars | \n",
+ " potass | \n",
+ " vitamins | \n",
+ " shelf | \n",
+ " weight | \n",
+ " cups | \n",
+ "
\n",
+ " \n",
+ " name | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 100%_Bran | \n",
+ " N | \n",
+ " C | \n",
+ " 70 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 130 | \n",
+ " 10.0 | \n",
+ " 5.000000 | \n",
+ " 6.000000 | \n",
+ " 280.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.33 | \n",
+ "
\n",
+ " \n",
+ " 100%_Natural_Bran | \n",
+ " Q | \n",
+ " C | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 5 | \n",
+ " 15 | \n",
+ " 2.0 | \n",
+ " 8.000000 | \n",
+ " 8.000000 | \n",
+ " 135.000000 | \n",
+ " 0 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " All-Bran | \n",
+ " K | \n",
+ " C | \n",
+ " 70 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 260 | \n",
+ " 9.0 | \n",
+ " 7.000000 | \n",
+ " 5.000000 | \n",
+ " 320.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.33 | \n",
+ "
\n",
+ " \n",
+ " All-Bran_with_Extra_Fiber | \n",
+ " K | \n",
+ " C | \n",
+ " 50 | \n",
+ " 4 | \n",
+ " 0 | \n",
+ " 140 | \n",
+ " 14.0 | \n",
+ " 8.000000 | \n",
+ " 0.000000 | \n",
+ " 330.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Almond_Delight | \n",
+ " R | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 200 | \n",
+ " 1.0 | \n",
+ " 14.000000 | \n",
+ " 8.000000 | \n",
+ " 98.666667 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Apple_Cinnamon_Cheerios | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 180 | \n",
+ " 1.5 | \n",
+ " 10.500000 | \n",
+ " 10.000000 | \n",
+ " 70.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Apple_Jacks | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 125 | \n",
+ " 1.0 | \n",
+ " 11.000000 | \n",
+ " 14.000000 | \n",
+ " 30.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Basic_4 | \n",
+ " G | \n",
+ " C | \n",
+ " 130 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 210 | \n",
+ " 2.0 | \n",
+ " 18.000000 | \n",
+ " 8.000000 | \n",
+ " 100.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.33 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Bran_Chex | \n",
+ " R | \n",
+ " C | \n",
+ " 90 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 4.0 | \n",
+ " 15.000000 | \n",
+ " 6.000000 | \n",
+ " 125.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Bran_Flakes | \n",
+ " P | \n",
+ " C | \n",
+ " 90 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 210 | \n",
+ " 5.0 | \n",
+ " 13.000000 | \n",
+ " 5.000000 | \n",
+ " 190.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Cap'n'Crunch | \n",
+ " Q | \n",
+ " C | \n",
+ " 120 | \n",
+ " 1 | \n",
+ " 2 | \n",
+ " 220 | \n",
+ " 0.0 | \n",
+ " 12.000000 | \n",
+ " 12.000000 | \n",
+ " 35.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Cheerios | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 6 | \n",
+ " 2 | \n",
+ " 290 | \n",
+ " 2.0 | \n",
+ " 17.000000 | \n",
+ " 1.000000 | \n",
+ " 105.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.25 | \n",
+ "
\n",
+ " \n",
+ " Cinnamon_Toast_Crunch | \n",
+ " G | \n",
+ " C | \n",
+ " 120 | \n",
+ " 1 | \n",
+ " 3 | \n",
+ " 210 | \n",
+ " 0.0 | \n",
+ " 13.000000 | \n",
+ " 9.000000 | \n",
+ " 45.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Clusters | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 140 | \n",
+ " 2.0 | \n",
+ " 13.000000 | \n",
+ " 7.000000 | \n",
+ " 105.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Cocoa_Puffs | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 180 | \n",
+ " 0.0 | \n",
+ " 12.000000 | \n",
+ " 13.000000 | \n",
+ " 55.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Corn_Chex | \n",
+ " R | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 280 | \n",
+ " 0.0 | \n",
+ " 22.000000 | \n",
+ " 3.000000 | \n",
+ " 25.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Corn_Flakes | \n",
+ " K | \n",
+ " C | \n",
+ " 100 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 290 | \n",
+ " 1.0 | \n",
+ " 21.000000 | \n",
+ " 2.000000 | \n",
+ " 35.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Corn_Pops | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 90 | \n",
+ " 1.0 | \n",
+ " 13.000000 | \n",
+ " 12.000000 | \n",
+ " 20.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Count_Chocula | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 180 | \n",
+ " 0.0 | \n",
+ " 12.000000 | \n",
+ " 13.000000 | \n",
+ " 65.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Cracklin'_Oat_Bran | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 3 | \n",
+ " 3 | \n",
+ " 140 | \n",
+ " 4.0 | \n",
+ " 10.000000 | \n",
+ " 7.000000 | \n",
+ " 160.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Cream_of_Wheat_(Quick) | \n",
+ " N | \n",
+ " H | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 80 | \n",
+ " 1.0 | \n",
+ " 21.000000 | \n",
+ " 0.000000 | \n",
+ " 98.666667 | \n",
+ " 0 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Crispix | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 220 | \n",
+ " 1.0 | \n",
+ " 21.000000 | \n",
+ " 3.000000 | \n",
+ " 30.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Crispy_Wheat_&_Raisins | \n",
+ " G | \n",
+ " C | \n",
+ " 100 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 140 | \n",
+ " 2.0 | \n",
+ " 11.000000 | \n",
+ " 10.000000 | \n",
+ " 120.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Double_Chex | \n",
+ " R | \n",
+ " C | \n",
+ " 100 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 190 | \n",
+ " 1.0 | \n",
+ " 18.000000 | \n",
+ " 5.000000 | \n",
+ " 80.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Froot_Loops | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 125 | \n",
+ " 1.0 | \n",
+ " 11.000000 | \n",
+ " 13.000000 | \n",
+ " 30.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Frosted_Flakes | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 200 | \n",
+ " 1.0 | \n",
+ " 14.000000 | \n",
+ " 11.000000 | \n",
+ " 25.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Frosted_Mini-Wheats | \n",
+ " K | \n",
+ " C | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 3.0 | \n",
+ " 14.000000 | \n",
+ " 7.000000 | \n",
+ " 100.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.80 | \n",
+ "
\n",
+ " \n",
+ " Fruit_&_Fibre_Dates,_Walnuts,_and_Oats | \n",
+ " P | \n",
+ " C | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 160 | \n",
+ " 5.0 | \n",
+ " 12.000000 | \n",
+ " 10.000000 | \n",
+ " 200.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.25 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Fruitful_Bran | \n",
+ " K | \n",
+ " C | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 240 | \n",
+ " 5.0 | \n",
+ " 14.000000 | \n",
+ " 12.000000 | \n",
+ " 190.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.33 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Fruity_Pebbles | \n",
+ " P | \n",
+ " C | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 135 | \n",
+ " 0.0 | \n",
+ " 13.000000 | \n",
+ " 12.000000 | \n",
+ " 25.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " Multi-Grain_Cheerios | \n",
+ " G | \n",
+ " C | \n",
+ " 100 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 220 | \n",
+ " 2.0 | \n",
+ " 15.000000 | \n",
+ " 6.000000 | \n",
+ " 90.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Nut&Honey_Crunch | \n",
+ " K | \n",
+ " C | \n",
+ " 120 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 190 | \n",
+ " 0.0 | \n",
+ " 15.000000 | \n",
+ " 9.000000 | \n",
+ " 40.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Nutri-Grain_Almond-Raisin | \n",
+ " K | \n",
+ " C | \n",
+ " 140 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 220 | \n",
+ " 3.0 | \n",
+ " 21.000000 | \n",
+ " 7.000000 | \n",
+ " 130.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.33 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Nutri-grain_Wheat | \n",
+ " K | \n",
+ " C | \n",
+ " 90 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 170 | \n",
+ " 3.0 | \n",
+ " 18.000000 | \n",
+ " 2.000000 | \n",
+ " 90.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Oatmeal_Raisin_Crisp | \n",
+ " G | \n",
+ " C | \n",
+ " 130 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 170 | \n",
+ " 1.5 | \n",
+ " 13.500000 | \n",
+ " 10.000000 | \n",
+ " 120.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.25 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Post_Nat._Raisin_Bran | \n",
+ " P | \n",
+ " C | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 6.0 | \n",
+ " 11.000000 | \n",
+ " 14.000000 | \n",
+ " 260.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.33 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Product_19 | \n",
+ " K | \n",
+ " C | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 320 | \n",
+ " 1.0 | \n",
+ " 20.000000 | \n",
+ " 3.000000 | \n",
+ " 45.000000 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Puffed_Rice | \n",
+ " Q | \n",
+ " C | \n",
+ " 50 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 0.0 | \n",
+ " 13.000000 | \n",
+ " 0.000000 | \n",
+ " 15.000000 | \n",
+ " 0 | \n",
+ " 3 | \n",
+ " 0.50 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Puffed_Wheat | \n",
+ " Q | \n",
+ " C | \n",
+ " 50 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 1.0 | \n",
+ " 10.000000 | \n",
+ " 0.000000 | \n",
+ " 50.000000 | \n",
+ " 0 | \n",
+ " 3 | \n",
+ " 0.50 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Quaker_Oat_Squares | \n",
+ " Q | \n",
+ " C | \n",
+ " 100 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 135 | \n",
+ " 2.0 | \n",
+ " 14.000000 | \n",
+ " 6.000000 | \n",
+ " 110.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Quaker_Oatmeal | \n",
+ " Q | \n",
+ " H | \n",
+ " 100 | \n",
+ " 5 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 2.7 | \n",
+ " 14.802632 | \n",
+ " 7.026316 | \n",
+ " 110.000000 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Raisin_Bran | \n",
+ " K | \n",
+ " C | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 210 | \n",
+ " 5.0 | \n",
+ " 14.000000 | \n",
+ " 12.000000 | \n",
+ " 240.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.33 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Raisin_Nut_Bran | \n",
+ " G | \n",
+ " C | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 140 | \n",
+ " 2.5 | \n",
+ " 10.500000 | \n",
+ " 8.000000 | \n",
+ " 140.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Raisin_Squares | \n",
+ " K | \n",
+ " C | \n",
+ " 90 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 2.0 | \n",
+ " 15.000000 | \n",
+ " 6.000000 | \n",
+ " 110.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Rice_Chex | \n",
+ " R | \n",
+ " C | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 240 | \n",
+ " 0.0 | \n",
+ " 23.000000 | \n",
+ " 2.000000 | \n",
+ " 30.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.13 | \n",
+ "
\n",
+ " \n",
+ " Rice_Krispies | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 290 | \n",
+ " 0.0 | \n",
+ " 22.000000 | \n",
+ " 3.000000 | \n",
+ " 35.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Shredded_Wheat | \n",
+ " N | \n",
+ " C | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 3.0 | \n",
+ " 16.000000 | \n",
+ " 0.000000 | \n",
+ " 95.000000 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 0.83 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Shredded_Wheat_'n'Bran | \n",
+ " N | \n",
+ " C | \n",
+ " 90 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 4.0 | \n",
+ " 19.000000 | \n",
+ " 0.000000 | \n",
+ " 140.000000 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Shredded_Wheat_spoon_size | \n",
+ " N | \n",
+ " C | \n",
+ " 90 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 3.0 | \n",
+ " 20.000000 | \n",
+ " 0.000000 | \n",
+ " 120.000000 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Smacks | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 70 | \n",
+ " 1.0 | \n",
+ " 9.000000 | \n",
+ " 15.000000 | \n",
+ " 40.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Special_K | \n",
+ " K | \n",
+ " C | \n",
+ " 110 | \n",
+ " 6 | \n",
+ " 0 | \n",
+ " 230 | \n",
+ " 1.0 | \n",
+ " 16.000000 | \n",
+ " 3.000000 | \n",
+ " 55.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Strawberry_Fruit_Wheats | \n",
+ " N | \n",
+ " C | \n",
+ " 90 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 15 | \n",
+ " 3.0 | \n",
+ " 15.000000 | \n",
+ " 5.000000 | \n",
+ " 90.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Total_Corn_Flakes | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 0.0 | \n",
+ " 21.000000 | \n",
+ " 3.000000 | \n",
+ " 35.000000 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Total_Raisin_Bran | \n",
+ " G | \n",
+ " C | \n",
+ " 140 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 190 | \n",
+ " 4.0 | \n",
+ " 15.000000 | \n",
+ " 14.000000 | \n",
+ " 230.000000 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1.50 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Total_Whole_Grain | \n",
+ " G | \n",
+ " C | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 3.0 | \n",
+ " 16.000000 | \n",
+ " 3.000000 | \n",
+ " 110.000000 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Triples | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 250 | \n",
+ " 0.0 | \n",
+ " 21.000000 | \n",
+ " 3.000000 | \n",
+ " 60.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Trix | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 140 | \n",
+ " 0.0 | \n",
+ " 13.000000 | \n",
+ " 12.000000 | \n",
+ " 25.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Wheat_Chex | \n",
+ " R | \n",
+ " C | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 230 | \n",
+ " 3.0 | \n",
+ " 17.000000 | \n",
+ " 3.000000 | \n",
+ " 115.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Wheaties | \n",
+ " G | \n",
+ " C | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 3.0 | \n",
+ " 17.000000 | \n",
+ " 3.000000 | \n",
+ " 110.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Wheaties_Honey_Gold | \n",
+ " G | \n",
+ " C | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 1.0 | \n",
+ " 16.000000 | \n",
+ " 8.000000 | \n",
+ " 60.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
77 rows × 14 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " mfr type calories protein fat \\\n",
+ "name \n",
+ "100%_Bran N C 70 4 1 \n",
+ "100%_Natural_Bran Q C 120 3 5 \n",
+ "All-Bran K C 70 4 1 \n",
+ "All-Bran_with_Extra_Fiber K C 50 4 0 \n",
+ "Almond_Delight R C 110 2 2 \n",
+ "Apple_Cinnamon_Cheerios G C 110 2 2 \n",
+ "Apple_Jacks K C 110 2 0 \n",
+ "Basic_4 G C 130 3 2 \n",
+ "Bran_Chex R C 90 2 1 \n",
+ "Bran_Flakes P C 90 3 0 \n",
+ "Cap'n'Crunch Q C 120 1 2 \n",
+ "Cheerios G C 110 6 2 \n",
+ "Cinnamon_Toast_Crunch G C 120 1 3 \n",
+ "Clusters G C 110 3 2 \n",
+ "Cocoa_Puffs G C 110 1 1 \n",
+ "Corn_Chex R C 110 2 0 \n",
+ "Corn_Flakes K C 100 2 0 \n",
+ "Corn_Pops K C 110 1 0 \n",
+ "Count_Chocula G C 110 1 1 \n",
+ "Cracklin'_Oat_Bran K C 110 3 3 \n",
+ "Cream_of_Wheat_(Quick) N H 100 3 0 \n",
+ "Crispix K C 110 2 0 \n",
+ "Crispy_Wheat_&_Raisins G C 100 2 1 \n",
+ "Double_Chex R C 100 2 0 \n",
+ "Froot_Loops K C 110 2 1 \n",
+ "Frosted_Flakes K C 110 1 0 \n",
+ "Frosted_Mini-Wheats K C 100 3 0 \n",
+ "Fruit_&_Fibre_Dates,_Walnuts,_and_Oats P C 120 3 2 \n",
+ "Fruitful_Bran K C 120 3 0 \n",
+ "Fruity_Pebbles P C 110 1 1 \n",
+ "... .. ... ... ... ... \n",
+ "Multi-Grain_Cheerios G C 100 2 1 \n",
+ "Nut&Honey_Crunch K C 120 2 1 \n",
+ "Nutri-Grain_Almond-Raisin K C 140 3 2 \n",
+ "Nutri-grain_Wheat K C 90 3 0 \n",
+ "Oatmeal_Raisin_Crisp G C 130 3 2 \n",
+ "Post_Nat._Raisin_Bran P C 120 3 1 \n",
+ "Product_19 K C 100 3 0 \n",
+ "Puffed_Rice Q C 50 1 0 \n",
+ "Puffed_Wheat Q C 50 2 0 \n",
+ "Quaker_Oat_Squares Q C 100 4 1 \n",
+ "Quaker_Oatmeal Q H 100 5 2 \n",
+ "Raisin_Bran K C 120 3 1 \n",
+ "Raisin_Nut_Bran G C 100 3 2 \n",
+ "Raisin_Squares K C 90 2 0 \n",
+ "Rice_Chex R C 110 1 0 \n",
+ "Rice_Krispies K C 110 2 0 \n",
+ "Shredded_Wheat N C 80 2 0 \n",
+ "Shredded_Wheat_'n'Bran N C 90 3 0 \n",
+ "Shredded_Wheat_spoon_size N C 90 3 0 \n",
+ "Smacks K C 110 2 1 \n",
+ "Special_K K C 110 6 0 \n",
+ "Strawberry_Fruit_Wheats N C 90 2 0 \n",
+ "Total_Corn_Flakes G C 110 2 1 \n",
+ "Total_Raisin_Bran G C 140 3 1 \n",
+ "Total_Whole_Grain G C 100 3 1 \n",
+ "Triples G C 110 2 1 \n",
+ "Trix G C 110 1 1 \n",
+ "Wheat_Chex R C 100 3 1 \n",
+ "Wheaties G C 100 3 1 \n",
+ "Wheaties_Honey_Gold G C 110 2 1 \n",
+ "\n",
+ " sodium fiber carbo sugars \\\n",
+ "name \n",
+ "100%_Bran 130 10.0 5.000000 6.000000 \n",
+ "100%_Natural_Bran 15 2.0 8.000000 8.000000 \n",
+ "All-Bran 260 9.0 7.000000 5.000000 \n",
+ "All-Bran_with_Extra_Fiber 140 14.0 8.000000 0.000000 \n",
+ "Almond_Delight 200 1.0 14.000000 8.000000 \n",
+ "Apple_Cinnamon_Cheerios 180 1.5 10.500000 10.000000 \n",
+ "Apple_Jacks 125 1.0 11.000000 14.000000 \n",
+ "Basic_4 210 2.0 18.000000 8.000000 \n",
+ "Bran_Chex 200 4.0 15.000000 6.000000 \n",
+ "Bran_Flakes 210 5.0 13.000000 5.000000 \n",
+ "Cap'n'Crunch 220 0.0 12.000000 12.000000 \n",
+ "Cheerios 290 2.0 17.000000 1.000000 \n",
+ "Cinnamon_Toast_Crunch 210 0.0 13.000000 9.000000 \n",
+ "Clusters 140 2.0 13.000000 7.000000 \n",
+ "Cocoa_Puffs 180 0.0 12.000000 13.000000 \n",
+ "Corn_Chex 280 0.0 22.000000 3.000000 \n",
+ "Corn_Flakes 290 1.0 21.000000 2.000000 \n",
+ "Corn_Pops 90 1.0 13.000000 12.000000 \n",
+ "Count_Chocula 180 0.0 12.000000 13.000000 \n",
+ "Cracklin'_Oat_Bran 140 4.0 10.000000 7.000000 \n",
+ "Cream_of_Wheat_(Quick) 80 1.0 21.000000 0.000000 \n",
+ "Crispix 220 1.0 21.000000 3.000000 \n",
+ "Crispy_Wheat_&_Raisins 140 2.0 11.000000 10.000000 \n",
+ "Double_Chex 190 1.0 18.000000 5.000000 \n",
+ "Froot_Loops 125 1.0 11.000000 13.000000 \n",
+ "Frosted_Flakes 200 1.0 14.000000 11.000000 \n",
+ "Frosted_Mini-Wheats 0 3.0 14.000000 7.000000 \n",
+ "Fruit_&_Fibre_Dates,_Walnuts,_and_Oats 160 5.0 12.000000 10.000000 \n",
+ "Fruitful_Bran 240 5.0 14.000000 12.000000 \n",
+ "Fruity_Pebbles 135 0.0 13.000000 12.000000 \n",
+ "... ... ... ... ... \n",
+ "Multi-Grain_Cheerios 220 2.0 15.000000 6.000000 \n",
+ "Nut&Honey_Crunch 190 0.0 15.000000 9.000000 \n",
+ "Nutri-Grain_Almond-Raisin 220 3.0 21.000000 7.000000 \n",
+ "Nutri-grain_Wheat 170 3.0 18.000000 2.000000 \n",
+ "Oatmeal_Raisin_Crisp 170 1.5 13.500000 10.000000 \n",
+ "Post_Nat._Raisin_Bran 200 6.0 11.000000 14.000000 \n",
+ "Product_19 320 1.0 20.000000 3.000000 \n",
+ "Puffed_Rice 0 0.0 13.000000 0.000000 \n",
+ "Puffed_Wheat 0 1.0 10.000000 0.000000 \n",
+ "Quaker_Oat_Squares 135 2.0 14.000000 6.000000 \n",
+ "Quaker_Oatmeal 0 2.7 14.802632 7.026316 \n",
+ "Raisin_Bran 210 5.0 14.000000 12.000000 \n",
+ "Raisin_Nut_Bran 140 2.5 10.500000 8.000000 \n",
+ "Raisin_Squares 0 2.0 15.000000 6.000000 \n",
+ "Rice_Chex 240 0.0 23.000000 2.000000 \n",
+ "Rice_Krispies 290 0.0 22.000000 3.000000 \n",
+ "Shredded_Wheat 0 3.0 16.000000 0.000000 \n",
+ "Shredded_Wheat_'n'Bran 0 4.0 19.000000 0.000000 \n",
+ "Shredded_Wheat_spoon_size 0 3.0 20.000000 0.000000 \n",
+ "Smacks 70 1.0 9.000000 15.000000 \n",
+ "Special_K 230 1.0 16.000000 3.000000 \n",
+ "Strawberry_Fruit_Wheats 15 3.0 15.000000 5.000000 \n",
+ "Total_Corn_Flakes 200 0.0 21.000000 3.000000 \n",
+ "Total_Raisin_Bran 190 4.0 15.000000 14.000000 \n",
+ "Total_Whole_Grain 200 3.0 16.000000 3.000000 \n",
+ "Triples 250 0.0 21.000000 3.000000 \n",
+ "Trix 140 0.0 13.000000 12.000000 \n",
+ "Wheat_Chex 230 3.0 17.000000 3.000000 \n",
+ "Wheaties 200 3.0 17.000000 3.000000 \n",
+ "Wheaties_Honey_Gold 200 1.0 16.000000 8.000000 \n",
+ "\n",
+ " potass vitamins shelf weight \\\n",
+ "name \n",
+ "100%_Bran 280.000000 25 3 1.00 \n",
+ "100%_Natural_Bran 135.000000 0 3 1.00 \n",
+ "All-Bran 320.000000 25 3 1.00 \n",
+ "All-Bran_with_Extra_Fiber 330.000000 25 3 1.00 \n",
+ "Almond_Delight 98.666667 25 3 1.00 \n",
+ "Apple_Cinnamon_Cheerios 70.000000 25 1 1.00 \n",
+ "Apple_Jacks 30.000000 25 2 1.00 \n",
+ "Basic_4 100.000000 25 3 1.33 \n",
+ "Bran_Chex 125.000000 25 1 1.00 \n",
+ "Bran_Flakes 190.000000 25 3 1.00 \n",
+ "Cap'n'Crunch 35.000000 25 2 1.00 \n",
+ "Cheerios 105.000000 25 1 1.00 \n",
+ "Cinnamon_Toast_Crunch 45.000000 25 2 1.00 \n",
+ "Clusters 105.000000 25 3 1.00 \n",
+ "Cocoa_Puffs 55.000000 25 2 1.00 \n",
+ "Corn_Chex 25.000000 25 1 1.00 \n",
+ "Corn_Flakes 35.000000 25 1 1.00 \n",
+ "Corn_Pops 20.000000 25 2 1.00 \n",
+ "Count_Chocula 65.000000 25 2 1.00 \n",
+ "Cracklin'_Oat_Bran 160.000000 25 3 1.00 \n",
+ "Cream_of_Wheat_(Quick) 98.666667 0 2 1.00 \n",
+ "Crispix 30.000000 25 3 1.00 \n",
+ "Crispy_Wheat_&_Raisins 120.000000 25 3 1.00 \n",
+ "Double_Chex 80.000000 25 3 1.00 \n",
+ "Froot_Loops 30.000000 25 2 1.00 \n",
+ "Frosted_Flakes 25.000000 25 1 1.00 \n",
+ "Frosted_Mini-Wheats 100.000000 25 2 1.00 \n",
+ "Fruit_&_Fibre_Dates,_Walnuts,_and_Oats 200.000000 25 3 1.25 \n",
+ "Fruitful_Bran 190.000000 25 3 1.33 \n",
+ "Fruity_Pebbles 25.000000 25 2 1.00 \n",
+ "... ... ... ... ... \n",
+ "Multi-Grain_Cheerios 90.000000 25 1 1.00 \n",
+ "Nut&Honey_Crunch 40.000000 25 2 1.00 \n",
+ "Nutri-Grain_Almond-Raisin 130.000000 25 3 1.33 \n",
+ "Nutri-grain_Wheat 90.000000 25 3 1.00 \n",
+ "Oatmeal_Raisin_Crisp 120.000000 25 3 1.25 \n",
+ "Post_Nat._Raisin_Bran 260.000000 25 3 1.33 \n",
+ "Product_19 45.000000 100 3 1.00 \n",
+ "Puffed_Rice 15.000000 0 3 0.50 \n",
+ "Puffed_Wheat 50.000000 0 3 0.50 \n",
+ "Quaker_Oat_Squares 110.000000 25 3 1.00 \n",
+ "Quaker_Oatmeal 110.000000 0 1 1.00 \n",
+ "Raisin_Bran 240.000000 25 2 1.33 \n",
+ "Raisin_Nut_Bran 140.000000 25 3 1.00 \n",
+ "Raisin_Squares 110.000000 25 3 1.00 \n",
+ "Rice_Chex 30.000000 25 1 1.00 \n",
+ "Rice_Krispies 35.000000 25 1 1.00 \n",
+ "Shredded_Wheat 95.000000 0 1 0.83 \n",
+ "Shredded_Wheat_'n'Bran 140.000000 0 1 1.00 \n",
+ "Shredded_Wheat_spoon_size 120.000000 0 1 1.00 \n",
+ "Smacks 40.000000 25 2 1.00 \n",
+ "Special_K 55.000000 25 1 1.00 \n",
+ "Strawberry_Fruit_Wheats 90.000000 25 2 1.00 \n",
+ "Total_Corn_Flakes 35.000000 100 3 1.00 \n",
+ "Total_Raisin_Bran 230.000000 100 3 1.50 \n",
+ "Total_Whole_Grain 110.000000 100 3 1.00 \n",
+ "Triples 60.000000 25 3 1.00 \n",
+ "Trix 25.000000 25 2 1.00 \n",
+ "Wheat_Chex 115.000000 25 1 1.00 \n",
+ "Wheaties 110.000000 25 1 1.00 \n",
+ "Wheaties_Honey_Gold 60.000000 25 1 1.00 \n",
+ "\n",
+ " cups \n",
+ "name \n",
+ "100%_Bran 0.33 \n",
+ "100%_Natural_Bran 1.00 \n",
+ "All-Bran 0.33 \n",
+ "All-Bran_with_Extra_Fiber 0.50 \n",
+ "Almond_Delight 0.75 \n",
+ "Apple_Cinnamon_Cheerios 0.75 \n",
+ "Apple_Jacks 1.00 \n",
+ "Basic_4 0.75 \n",
+ "Bran_Chex 0.67 \n",
+ "Bran_Flakes 0.67 \n",
+ "Cap'n'Crunch 0.75 \n",
+ "Cheerios 1.25 \n",
+ "Cinnamon_Toast_Crunch 0.75 \n",
+ "Clusters 0.50 \n",
+ "Cocoa_Puffs 1.00 \n",
+ "Corn_Chex 1.00 \n",
+ "Corn_Flakes 1.00 \n",
+ "Corn_Pops 1.00 \n",
+ "Count_Chocula 1.00 \n",
+ "Cracklin'_Oat_Bran 0.50 \n",
+ "Cream_of_Wheat_(Quick) 1.00 \n",
+ "Crispix 1.00 \n",
+ "Crispy_Wheat_&_Raisins 0.75 \n",
+ "Double_Chex 0.75 \n",
+ "Froot_Loops 1.00 \n",
+ "Frosted_Flakes 0.75 \n",
+ "Frosted_Mini-Wheats 0.80 \n",
+ "Fruit_&_Fibre_Dates,_Walnuts,_and_Oats 0.67 \n",
+ "Fruitful_Bran 0.67 \n",
+ "Fruity_Pebbles 0.75 \n",
+ "... ... \n",
+ "Multi-Grain_Cheerios 1.00 \n",
+ "Nut&Honey_Crunch 0.67 \n",
+ "Nutri-Grain_Almond-Raisin 0.67 \n",
+ "Nutri-grain_Wheat 1.00 \n",
+ "Oatmeal_Raisin_Crisp 0.50 \n",
+ "Post_Nat._Raisin_Bran 0.67 \n",
+ "Product_19 1.00 \n",
+ "Puffed_Rice 1.00 \n",
+ "Puffed_Wheat 1.00 \n",
+ "Quaker_Oat_Squares 0.50 \n",
+ "Quaker_Oatmeal 0.67 \n",
+ "Raisin_Bran 0.75 \n",
+ "Raisin_Nut_Bran 0.50 \n",
+ "Raisin_Squares 0.50 \n",
+ "Rice_Chex 1.13 \n",
+ "Rice_Krispies 1.00 \n",
+ "Shredded_Wheat 1.00 \n",
+ "Shredded_Wheat_'n'Bran 0.67 \n",
+ "Shredded_Wheat_spoon_size 0.67 \n",
+ "Smacks 0.75 \n",
+ "Special_K 1.00 \n",
+ "Strawberry_Fruit_Wheats 1.00 \n",
+ "Total_Corn_Flakes 1.00 \n",
+ "Total_Raisin_Bran 1.00 \n",
+ "Total_Whole_Grain 1.00 \n",
+ "Triples 0.75 \n",
+ "Trix 1.00 \n",
+ "Wheat_Chex 0.67 \n",
+ "Wheaties 1.00 \n",
+ "Wheaties_Honey_Gold 0.75 \n",
+ "\n",
+ "[77 rows x 14 columns]"
+ ]
+ },
+ "execution_count": 52,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "filled_in_df"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "filled_in_df_removed = filled_in_df.drop(['mfr', 'type'], 1)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " calories | \n",
+ " protein | \n",
+ " fat | \n",
+ " sodium | \n",
+ " fiber | \n",
+ " carbo | \n",
+ " sugars | \n",
+ " potass | \n",
+ " vitamins | \n",
+ " shelf | \n",
+ " weight | \n",
+ " cups | \n",
+ "
\n",
+ " \n",
+ " name | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 100%_Bran | \n",
+ " 70 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 130 | \n",
+ " 10 | \n",
+ " 5 | \n",
+ " 6 | \n",
+ " 280.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.33 | \n",
+ "
\n",
+ " \n",
+ " 100%_Natural_Bran | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 5 | \n",
+ " 15 | \n",
+ " 2 | \n",
+ " 8 | \n",
+ " 8 | \n",
+ " 135.000000 | \n",
+ " 0 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " All-Bran | \n",
+ " 70 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 260 | \n",
+ " 9 | \n",
+ " 7 | \n",
+ " 5 | \n",
+ " 320.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.33 | \n",
+ "
\n",
+ " \n",
+ " All-Bran_with_Extra_Fiber | \n",
+ " 50 | \n",
+ " 4 | \n",
+ " 0 | \n",
+ " 140 | \n",
+ " 14 | \n",
+ " 8 | \n",
+ " 0 | \n",
+ " 330.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Almond_Delight | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 200 | \n",
+ " 1 | \n",
+ " 14 | \n",
+ " 8 | \n",
+ " 98.666667 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " calories protein fat sodium fiber carbo \\\n",
+ "name \n",
+ "100%_Bran 70 4 1 130 10 5 \n",
+ "100%_Natural_Bran 120 3 5 15 2 8 \n",
+ "All-Bran 70 4 1 260 9 7 \n",
+ "All-Bran_with_Extra_Fiber 50 4 0 140 14 8 \n",
+ "Almond_Delight 110 2 2 200 1 14 \n",
+ "\n",
+ " sugars potass vitamins shelf weight cups \n",
+ "name \n",
+ "100%_Bran 6 280.000000 25 3 1 0.33 \n",
+ "100%_Natural_Bran 8 135.000000 0 3 1 1.00 \n",
+ "All-Bran 5 320.000000 25 3 1 0.33 \n",
+ "All-Bran_with_Extra_Fiber 0 330.000000 25 3 1 0.50 \n",
+ "Almond_Delight 8 98.666667 25 3 1 0.75 "
+ ]
+ },
+ "execution_count": 54,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "filled_in_df_removed.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "calories int64\n",
+ "protein int64\n",
+ "fat int64\n",
+ "sodium int64\n",
+ "fiber float64\n",
+ "carbo float64\n",
+ "sugars float64\n",
+ "potass float64\n",
+ "vitamins int64\n",
+ "shelf int64\n",
+ "weight float64\n",
+ "cups float64\n",
+ "dtype: object"
+ ]
+ },
+ "execution_count": 55,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "filled_in_df_removed.dtypes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Normalizing:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "test_mult = filled_in_df_removed*3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " calories | \n",
+ " protein | \n",
+ " fat | \n",
+ " sodium | \n",
+ " fiber | \n",
+ " carbo | \n",
+ " sugars | \n",
+ " potass | \n",
+ " vitamins | \n",
+ " shelf | \n",
+ " weight | \n",
+ " cups | \n",
+ "
\n",
+ " \n",
+ " name | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 100%_Bran | \n",
+ " 210 | \n",
+ " 12 | \n",
+ " 3 | \n",
+ " 390 | \n",
+ " 30 | \n",
+ " 15 | \n",
+ " 18 | \n",
+ " 840 | \n",
+ " 75 | \n",
+ " 9 | \n",
+ " 3 | \n",
+ " 0.99 | \n",
+ "
\n",
+ " \n",
+ " 100%_Natural_Bran | \n",
+ " 360 | \n",
+ " 9 | \n",
+ " 15 | \n",
+ " 45 | \n",
+ " 6 | \n",
+ " 24 | \n",
+ " 24 | \n",
+ " 405 | \n",
+ " 0 | \n",
+ " 9 | \n",
+ " 3 | \n",
+ " 3.00 | \n",
+ "
\n",
+ " \n",
+ " All-Bran | \n",
+ " 210 | \n",
+ " 12 | \n",
+ " 3 | \n",
+ " 780 | \n",
+ " 27 | \n",
+ " 21 | \n",
+ " 15 | \n",
+ " 960 | \n",
+ " 75 | \n",
+ " 9 | \n",
+ " 3 | \n",
+ " 0.99 | \n",
+ "
\n",
+ " \n",
+ " All-Bran_with_Extra_Fiber | \n",
+ " 150 | \n",
+ " 12 | \n",
+ " 0 | \n",
+ " 420 | \n",
+ " 42 | \n",
+ " 24 | \n",
+ " 0 | \n",
+ " 990 | \n",
+ " 75 | \n",
+ " 9 | \n",
+ " 3 | \n",
+ " 1.50 | \n",
+ "
\n",
+ " \n",
+ " Almond_Delight | \n",
+ " 330 | \n",
+ " 6 | \n",
+ " 6 | \n",
+ " 600 | \n",
+ " 3 | \n",
+ " 42 | \n",
+ " 24 | \n",
+ " 296 | \n",
+ " 75 | \n",
+ " 9 | \n",
+ " 3 | \n",
+ " 2.25 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ " calories protein fat sodium fiber carbo \\\n",
+ "name \n",
+ "100%_Bran 210 12 3 390 30 15 \n",
+ "100%_Natural_Bran 360 9 15 45 6 24 \n",
+ "All-Bran 210 12 3 780 27 21 \n",
+ "All-Bran_with_Extra_Fiber 150 12 0 420 42 24 \n",
+ "Almond_Delight 330 6 6 600 3 42 \n",
+ "\n",
+ " sugars potass vitamins shelf weight cups \n",
+ "name \n",
+ "100%_Bran 18 840 75 9 3 0.99 \n",
+ "100%_Natural_Bran 24 405 0 9 3 3.00 \n",
+ "All-Bran 15 960 75 9 3 0.99 \n",
+ "All-Bran_with_Extra_Fiber 0 990 75 9 3 1.50 \n",
+ "Almond_Delight 24 296 75 9 3 2.25 "
+ ]
+ },
+ "execution_count": 57,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "test_mult.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "3.0"
+ ]
+ },
+ "execution_count": 58,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "test_mult.iloc[2, 10]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "def normalize(data_frame):\n",
+ " for i in range(len(data_frame)):\n",
+ " data_frame.iloc[i]*1/data_frame.iloc[i, 10]\n",
+ " return data_frame\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " calories | \n",
+ " protein | \n",
+ " fat | \n",
+ " sodium | \n",
+ " fiber | \n",
+ " carbo | \n",
+ " sugars | \n",
+ " potass | \n",
+ " vitamins | \n",
+ " shelf | \n",
+ " weight | \n",
+ " cups | \n",
+ "
\n",
+ " \n",
+ " name | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 100%_Bran | \n",
+ " 70 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 130 | \n",
+ " 10.0 | \n",
+ " 5.000000 | \n",
+ " 6.000000 | \n",
+ " 280.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.33 | \n",
+ "
\n",
+ " \n",
+ " 100%_Natural_Bran | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 5 | \n",
+ " 15 | \n",
+ " 2.0 | \n",
+ " 8.000000 | \n",
+ " 8.000000 | \n",
+ " 135.000000 | \n",
+ " 0 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " All-Bran | \n",
+ " 70 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 260 | \n",
+ " 9.0 | \n",
+ " 7.000000 | \n",
+ " 5.000000 | \n",
+ " 320.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.33 | \n",
+ "
\n",
+ " \n",
+ " All-Bran_with_Extra_Fiber | \n",
+ " 50 | \n",
+ " 4 | \n",
+ " 0 | \n",
+ " 140 | \n",
+ " 14.0 | \n",
+ " 8.000000 | \n",
+ " 0.000000 | \n",
+ " 330.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Almond_Delight | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 200 | \n",
+ " 1.0 | \n",
+ " 14.000000 | \n",
+ " 8.000000 | \n",
+ " 98.666667 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Apple_Cinnamon_Cheerios | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 2 | \n",
+ " 180 | \n",
+ " 1.5 | \n",
+ " 10.500000 | \n",
+ " 10.000000 | \n",
+ " 70.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Apple_Jacks | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 125 | \n",
+ " 1.0 | \n",
+ " 11.000000 | \n",
+ " 14.000000 | \n",
+ " 30.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Basic_4 | \n",
+ " 130 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 210 | \n",
+ " 2.0 | \n",
+ " 18.000000 | \n",
+ " 8.000000 | \n",
+ " 100.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.33 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Bran_Chex | \n",
+ " 90 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 4.0 | \n",
+ " 15.000000 | \n",
+ " 6.000000 | \n",
+ " 125.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Bran_Flakes | \n",
+ " 90 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 210 | \n",
+ " 5.0 | \n",
+ " 13.000000 | \n",
+ " 5.000000 | \n",
+ " 190.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Cap'n'Crunch | \n",
+ " 120 | \n",
+ " 1 | \n",
+ " 2 | \n",
+ " 220 | \n",
+ " 0.0 | \n",
+ " 12.000000 | \n",
+ " 12.000000 | \n",
+ " 35.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Cheerios | \n",
+ " 110 | \n",
+ " 6 | \n",
+ " 2 | \n",
+ " 290 | \n",
+ " 2.0 | \n",
+ " 17.000000 | \n",
+ " 1.000000 | \n",
+ " 105.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.25 | \n",
+ "
\n",
+ " \n",
+ " Cinnamon_Toast_Crunch | \n",
+ " 120 | \n",
+ " 1 | \n",
+ " 3 | \n",
+ " 210 | \n",
+ " 0.0 | \n",
+ " 13.000000 | \n",
+ " 9.000000 | \n",
+ " 45.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Clusters | \n",
+ " 110 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 140 | \n",
+ " 2.0 | \n",
+ " 13.000000 | \n",
+ " 7.000000 | \n",
+ " 105.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Cocoa_Puffs | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 180 | \n",
+ " 0.0 | \n",
+ " 12.000000 | \n",
+ " 13.000000 | \n",
+ " 55.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Corn_Chex | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 280 | \n",
+ " 0.0 | \n",
+ " 22.000000 | \n",
+ " 3.000000 | \n",
+ " 25.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Corn_Flakes | \n",
+ " 100 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 290 | \n",
+ " 1.0 | \n",
+ " 21.000000 | \n",
+ " 2.000000 | \n",
+ " 35.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Corn_Pops | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 90 | \n",
+ " 1.0 | \n",
+ " 13.000000 | \n",
+ " 12.000000 | \n",
+ " 20.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Count_Chocula | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 180 | \n",
+ " 0.0 | \n",
+ " 12.000000 | \n",
+ " 13.000000 | \n",
+ " 65.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Cracklin'_Oat_Bran | \n",
+ " 110 | \n",
+ " 3 | \n",
+ " 3 | \n",
+ " 140 | \n",
+ " 4.0 | \n",
+ " 10.000000 | \n",
+ " 7.000000 | \n",
+ " 160.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Cream_of_Wheat_(Quick) | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 80 | \n",
+ " 1.0 | \n",
+ " 21.000000 | \n",
+ " 0.000000 | \n",
+ " 98.666667 | \n",
+ " 0 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Crispix | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 220 | \n",
+ " 1.0 | \n",
+ " 21.000000 | \n",
+ " 3.000000 | \n",
+ " 30.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Crispy_Wheat_&_Raisins | \n",
+ " 100 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 140 | \n",
+ " 2.0 | \n",
+ " 11.000000 | \n",
+ " 10.000000 | \n",
+ " 120.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Double_Chex | \n",
+ " 100 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 190 | \n",
+ " 1.0 | \n",
+ " 18.000000 | \n",
+ " 5.000000 | \n",
+ " 80.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Froot_Loops | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 125 | \n",
+ " 1.0 | \n",
+ " 11.000000 | \n",
+ " 13.000000 | \n",
+ " 30.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Frosted_Flakes | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 200 | \n",
+ " 1.0 | \n",
+ " 14.000000 | \n",
+ " 11.000000 | \n",
+ " 25.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Frosted_Mini-Wheats | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 3.0 | \n",
+ " 14.000000 | \n",
+ " 7.000000 | \n",
+ " 100.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.80 | \n",
+ "
\n",
+ " \n",
+ " Fruit_&_Fibre_Dates,_Walnuts,_and_Oats | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 160 | \n",
+ " 5.0 | \n",
+ " 12.000000 | \n",
+ " 10.000000 | \n",
+ " 200.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.25 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Fruitful_Bran | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 240 | \n",
+ " 5.0 | \n",
+ " 14.000000 | \n",
+ " 12.000000 | \n",
+ " 190.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.33 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Fruity_Pebbles | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 135 | \n",
+ " 0.0 | \n",
+ " 13.000000 | \n",
+ " 12.000000 | \n",
+ " 25.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " Multi-Grain_Cheerios | \n",
+ " 100 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 220 | \n",
+ " 2.0 | \n",
+ " 15.000000 | \n",
+ " 6.000000 | \n",
+ " 90.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Nut&Honey_Crunch | \n",
+ " 120 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 190 | \n",
+ " 0.0 | \n",
+ " 15.000000 | \n",
+ " 9.000000 | \n",
+ " 40.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Nutri-Grain_Almond-Raisin | \n",
+ " 140 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 220 | \n",
+ " 3.0 | \n",
+ " 21.000000 | \n",
+ " 7.000000 | \n",
+ " 130.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.33 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Nutri-grain_Wheat | \n",
+ " 90 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 170 | \n",
+ " 3.0 | \n",
+ " 18.000000 | \n",
+ " 2.000000 | \n",
+ " 90.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Oatmeal_Raisin_Crisp | \n",
+ " 130 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 170 | \n",
+ " 1.5 | \n",
+ " 13.500000 | \n",
+ " 10.000000 | \n",
+ " 120.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.25 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Post_Nat._Raisin_Bran | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 6.0 | \n",
+ " 11.000000 | \n",
+ " 14.000000 | \n",
+ " 260.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.33 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Product_19 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 320 | \n",
+ " 1.0 | \n",
+ " 20.000000 | \n",
+ " 3.000000 | \n",
+ " 45.000000 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Puffed_Rice | \n",
+ " 50 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 0.0 | \n",
+ " 13.000000 | \n",
+ " 0.000000 | \n",
+ " 15.000000 | \n",
+ " 0 | \n",
+ " 3 | \n",
+ " 0.50 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Puffed_Wheat | \n",
+ " 50 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 1.0 | \n",
+ " 10.000000 | \n",
+ " 0.000000 | \n",
+ " 50.000000 | \n",
+ " 0 | \n",
+ " 3 | \n",
+ " 0.50 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Quaker_Oat_Squares | \n",
+ " 100 | \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 135 | \n",
+ " 2.0 | \n",
+ " 14.000000 | \n",
+ " 6.000000 | \n",
+ " 110.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Quaker_Oatmeal | \n",
+ " 100 | \n",
+ " 5 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 2.7 | \n",
+ " 14.802632 | \n",
+ " 7.026316 | \n",
+ " 110.000000 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Raisin_Bran | \n",
+ " 120 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 210 | \n",
+ " 5.0 | \n",
+ " 14.000000 | \n",
+ " 12.000000 | \n",
+ " 240.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.33 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Raisin_Nut_Bran | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 2 | \n",
+ " 140 | \n",
+ " 2.5 | \n",
+ " 10.500000 | \n",
+ " 8.000000 | \n",
+ " 140.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Raisin_Squares | \n",
+ " 90 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 2.0 | \n",
+ " 15.000000 | \n",
+ " 6.000000 | \n",
+ " 110.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.50 | \n",
+ "
\n",
+ " \n",
+ " Rice_Chex | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 0 | \n",
+ " 240 | \n",
+ " 0.0 | \n",
+ " 23.000000 | \n",
+ " 2.000000 | \n",
+ " 30.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.13 | \n",
+ "
\n",
+ " \n",
+ " Rice_Krispies | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 290 | \n",
+ " 0.0 | \n",
+ " 22.000000 | \n",
+ " 3.000000 | \n",
+ " 35.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Shredded_Wheat | \n",
+ " 80 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 3.0 | \n",
+ " 16.000000 | \n",
+ " 0.000000 | \n",
+ " 95.000000 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 0.83 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Shredded_Wheat_'n'Bran | \n",
+ " 90 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 4.0 | \n",
+ " 19.000000 | \n",
+ " 0.000000 | \n",
+ " 140.000000 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Shredded_Wheat_spoon_size | \n",
+ " 90 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 0 | \n",
+ " 3.0 | \n",
+ " 20.000000 | \n",
+ " 0.000000 | \n",
+ " 120.000000 | \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Smacks | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 70 | \n",
+ " 1.0 | \n",
+ " 9.000000 | \n",
+ " 15.000000 | \n",
+ " 40.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Special_K | \n",
+ " 110 | \n",
+ " 6 | \n",
+ " 0 | \n",
+ " 230 | \n",
+ " 1.0 | \n",
+ " 16.000000 | \n",
+ " 3.000000 | \n",
+ " 55.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Strawberry_Fruit_Wheats | \n",
+ " 90 | \n",
+ " 2 | \n",
+ " 0 | \n",
+ " 15 | \n",
+ " 3.0 | \n",
+ " 15.000000 | \n",
+ " 5.000000 | \n",
+ " 90.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Total_Corn_Flakes | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 0.0 | \n",
+ " 21.000000 | \n",
+ " 3.000000 | \n",
+ " 35.000000 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Total_Raisin_Bran | \n",
+ " 140 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 190 | \n",
+ " 4.0 | \n",
+ " 15.000000 | \n",
+ " 14.000000 | \n",
+ " 230.000000 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1.50 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Total_Whole_Grain | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 3.0 | \n",
+ " 16.000000 | \n",
+ " 3.000000 | \n",
+ " 110.000000 | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Triples | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 250 | \n",
+ " 0.0 | \n",
+ " 21.000000 | \n",
+ " 3.000000 | \n",
+ " 60.000000 | \n",
+ " 25 | \n",
+ " 3 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ " Trix | \n",
+ " 110 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 140 | \n",
+ " 0.0 | \n",
+ " 13.000000 | \n",
+ " 12.000000 | \n",
+ " 25.000000 | \n",
+ " 25 | \n",
+ " 2 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Wheat_Chex | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 230 | \n",
+ " 3.0 | \n",
+ " 17.000000 | \n",
+ " 3.000000 | \n",
+ " 115.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.67 | \n",
+ "
\n",
+ " \n",
+ " Wheaties | \n",
+ " 100 | \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 3.0 | \n",
+ " 17.000000 | \n",
+ " 3.000000 | \n",
+ " 110.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 1.00 | \n",
+ "
\n",
+ " \n",
+ " Wheaties_Honey_Gold | \n",
+ " 110 | \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 200 | \n",
+ " 1.0 | \n",
+ " 16.000000 | \n",
+ " 8.000000 | \n",
+ " 60.000000 | \n",
+ " 25 | \n",
+ " 1 | \n",
+ " 1.00 | \n",
+ " 0.75 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
77 rows × 12 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " calories protein fat sodium fiber \\\n",
+ "name \n",
+ "100%_Bran 70 4 1 130 10.0 \n",
+ "100%_Natural_Bran 120 3 5 15 2.0 \n",
+ "All-Bran 70 4 1 260 9.0 \n",
+ "All-Bran_with_Extra_Fiber 50 4 0 140 14.0 \n",
+ "Almond_Delight 110 2 2 200 1.0 \n",
+ "Apple_Cinnamon_Cheerios 110 2 2 180 1.5 \n",
+ "Apple_Jacks 110 2 0 125 1.0 \n",
+ "Basic_4 130 3 2 210 2.0 \n",
+ "Bran_Chex 90 2 1 200 4.0 \n",
+ "Bran_Flakes 90 3 0 210 5.0 \n",
+ "Cap'n'Crunch 120 1 2 220 0.0 \n",
+ "Cheerios 110 6 2 290 2.0 \n",
+ "Cinnamon_Toast_Crunch 120 1 3 210 0.0 \n",
+ "Clusters 110 3 2 140 2.0 \n",
+ "Cocoa_Puffs 110 1 1 180 0.0 \n",
+ "Corn_Chex 110 2 0 280 0.0 \n",
+ "Corn_Flakes 100 2 0 290 1.0 \n",
+ "Corn_Pops 110 1 0 90 1.0 \n",
+ "Count_Chocula 110 1 1 180 0.0 \n",
+ "Cracklin'_Oat_Bran 110 3 3 140 4.0 \n",
+ "Cream_of_Wheat_(Quick) 100 3 0 80 1.0 \n",
+ "Crispix 110 2 0 220 1.0 \n",
+ "Crispy_Wheat_&_Raisins 100 2 1 140 2.0 \n",
+ "Double_Chex 100 2 0 190 1.0 \n",
+ "Froot_Loops 110 2 1 125 1.0 \n",
+ "Frosted_Flakes 110 1 0 200 1.0 \n",
+ "Frosted_Mini-Wheats 100 3 0 0 3.0 \n",
+ "Fruit_&_Fibre_Dates,_Walnuts,_and_Oats 120 3 2 160 5.0 \n",
+ "Fruitful_Bran 120 3 0 240 5.0 \n",
+ "Fruity_Pebbles 110 1 1 135 0.0 \n",
+ "... ... ... ... ... ... \n",
+ "Multi-Grain_Cheerios 100 2 1 220 2.0 \n",
+ "Nut&Honey_Crunch 120 2 1 190 0.0 \n",
+ "Nutri-Grain_Almond-Raisin 140 3 2 220 3.0 \n",
+ "Nutri-grain_Wheat 90 3 0 170 3.0 \n",
+ "Oatmeal_Raisin_Crisp 130 3 2 170 1.5 \n",
+ "Post_Nat._Raisin_Bran 120 3 1 200 6.0 \n",
+ "Product_19 100 3 0 320 1.0 \n",
+ "Puffed_Rice 50 1 0 0 0.0 \n",
+ "Puffed_Wheat 50 2 0 0 1.0 \n",
+ "Quaker_Oat_Squares 100 4 1 135 2.0 \n",
+ "Quaker_Oatmeal 100 5 2 0 2.7 \n",
+ "Raisin_Bran 120 3 1 210 5.0 \n",
+ "Raisin_Nut_Bran 100 3 2 140 2.5 \n",
+ "Raisin_Squares 90 2 0 0 2.0 \n",
+ "Rice_Chex 110 1 0 240 0.0 \n",
+ "Rice_Krispies 110 2 0 290 0.0 \n",
+ "Shredded_Wheat 80 2 0 0 3.0 \n",
+ "Shredded_Wheat_'n'Bran 90 3 0 0 4.0 \n",
+ "Shredded_Wheat_spoon_size 90 3 0 0 3.0 \n",
+ "Smacks 110 2 1 70 1.0 \n",
+ "Special_K 110 6 0 230 1.0 \n",
+ "Strawberry_Fruit_Wheats 90 2 0 15 3.0 \n",
+ "Total_Corn_Flakes 110 2 1 200 0.0 \n",
+ "Total_Raisin_Bran 140 3 1 190 4.0 \n",
+ "Total_Whole_Grain 100 3 1 200 3.0 \n",
+ "Triples 110 2 1 250 0.0 \n",
+ "Trix 110 1 1 140 0.0 \n",
+ "Wheat_Chex 100 3 1 230 3.0 \n",
+ "Wheaties 100 3 1 200 3.0 \n",
+ "Wheaties_Honey_Gold 110 2 1 200 1.0 \n",
+ "\n",
+ " carbo sugars potass \\\n",
+ "name \n",
+ "100%_Bran 5.000000 6.000000 280.000000 \n",
+ "100%_Natural_Bran 8.000000 8.000000 135.000000 \n",
+ "All-Bran 7.000000 5.000000 320.000000 \n",
+ "All-Bran_with_Extra_Fiber 8.000000 0.000000 330.000000 \n",
+ "Almond_Delight 14.000000 8.000000 98.666667 \n",
+ "Apple_Cinnamon_Cheerios 10.500000 10.000000 70.000000 \n",
+ "Apple_Jacks 11.000000 14.000000 30.000000 \n",
+ "Basic_4 18.000000 8.000000 100.000000 \n",
+ "Bran_Chex 15.000000 6.000000 125.000000 \n",
+ "Bran_Flakes 13.000000 5.000000 190.000000 \n",
+ "Cap'n'Crunch 12.000000 12.000000 35.000000 \n",
+ "Cheerios 17.000000 1.000000 105.000000 \n",
+ "Cinnamon_Toast_Crunch 13.000000 9.000000 45.000000 \n",
+ "Clusters 13.000000 7.000000 105.000000 \n",
+ "Cocoa_Puffs 12.000000 13.000000 55.000000 \n",
+ "Corn_Chex 22.000000 3.000000 25.000000 \n",
+ "Corn_Flakes 21.000000 2.000000 35.000000 \n",
+ "Corn_Pops 13.000000 12.000000 20.000000 \n",
+ "Count_Chocula 12.000000 13.000000 65.000000 \n",
+ "Cracklin'_Oat_Bran 10.000000 7.000000 160.000000 \n",
+ "Cream_of_Wheat_(Quick) 21.000000 0.000000 98.666667 \n",
+ "Crispix 21.000000 3.000000 30.000000 \n",
+ "Crispy_Wheat_&_Raisins 11.000000 10.000000 120.000000 \n",
+ "Double_Chex 18.000000 5.000000 80.000000 \n",
+ "Froot_Loops 11.000000 13.000000 30.000000 \n",
+ "Frosted_Flakes 14.000000 11.000000 25.000000 \n",
+ "Frosted_Mini-Wheats 14.000000 7.000000 100.000000 \n",
+ "Fruit_&_Fibre_Dates,_Walnuts,_and_Oats 12.000000 10.000000 200.000000 \n",
+ "Fruitful_Bran 14.000000 12.000000 190.000000 \n",
+ "Fruity_Pebbles 13.000000 12.000000 25.000000 \n",
+ "... ... ... ... \n",
+ "Multi-Grain_Cheerios 15.000000 6.000000 90.000000 \n",
+ "Nut&Honey_Crunch 15.000000 9.000000 40.000000 \n",
+ "Nutri-Grain_Almond-Raisin 21.000000 7.000000 130.000000 \n",
+ "Nutri-grain_Wheat 18.000000 2.000000 90.000000 \n",
+ "Oatmeal_Raisin_Crisp 13.500000 10.000000 120.000000 \n",
+ "Post_Nat._Raisin_Bran 11.000000 14.000000 260.000000 \n",
+ "Product_19 20.000000 3.000000 45.000000 \n",
+ "Puffed_Rice 13.000000 0.000000 15.000000 \n",
+ "Puffed_Wheat 10.000000 0.000000 50.000000 \n",
+ "Quaker_Oat_Squares 14.000000 6.000000 110.000000 \n",
+ "Quaker_Oatmeal 14.802632 7.026316 110.000000 \n",
+ "Raisin_Bran 14.000000 12.000000 240.000000 \n",
+ "Raisin_Nut_Bran 10.500000 8.000000 140.000000 \n",
+ "Raisin_Squares 15.000000 6.000000 110.000000 \n",
+ "Rice_Chex 23.000000 2.000000 30.000000 \n",
+ "Rice_Krispies 22.000000 3.000000 35.000000 \n",
+ "Shredded_Wheat 16.000000 0.000000 95.000000 \n",
+ "Shredded_Wheat_'n'Bran 19.000000 0.000000 140.000000 \n",
+ "Shredded_Wheat_spoon_size 20.000000 0.000000 120.000000 \n",
+ "Smacks 9.000000 15.000000 40.000000 \n",
+ "Special_K 16.000000 3.000000 55.000000 \n",
+ "Strawberry_Fruit_Wheats 15.000000 5.000000 90.000000 \n",
+ "Total_Corn_Flakes 21.000000 3.000000 35.000000 \n",
+ "Total_Raisin_Bran 15.000000 14.000000 230.000000 \n",
+ "Total_Whole_Grain 16.000000 3.000000 110.000000 \n",
+ "Triples 21.000000 3.000000 60.000000 \n",
+ "Trix 13.000000 12.000000 25.000000 \n",
+ "Wheat_Chex 17.000000 3.000000 115.000000 \n",
+ "Wheaties 17.000000 3.000000 110.000000 \n",
+ "Wheaties_Honey_Gold 16.000000 8.000000 60.000000 \n",
+ "\n",
+ " vitamins shelf weight cups \n",
+ "name \n",
+ "100%_Bran 25 3 1.00 0.33 \n",
+ "100%_Natural_Bran 0 3 1.00 1.00 \n",
+ "All-Bran 25 3 1.00 0.33 \n",
+ "All-Bran_with_Extra_Fiber 25 3 1.00 0.50 \n",
+ "Almond_Delight 25 3 1.00 0.75 \n",
+ "Apple_Cinnamon_Cheerios 25 1 1.00 0.75 \n",
+ "Apple_Jacks 25 2 1.00 1.00 \n",
+ "Basic_4 25 3 1.33 0.75 \n",
+ "Bran_Chex 25 1 1.00 0.67 \n",
+ "Bran_Flakes 25 3 1.00 0.67 \n",
+ "Cap'n'Crunch 25 2 1.00 0.75 \n",
+ "Cheerios 25 1 1.00 1.25 \n",
+ "Cinnamon_Toast_Crunch 25 2 1.00 0.75 \n",
+ "Clusters 25 3 1.00 0.50 \n",
+ "Cocoa_Puffs 25 2 1.00 1.00 \n",
+ "Corn_Chex 25 1 1.00 1.00 \n",
+ "Corn_Flakes 25 1 1.00 1.00 \n",
+ "Corn_Pops 25 2 1.00 1.00 \n",
+ "Count_Chocula 25 2 1.00 1.00 \n",
+ "Cracklin'_Oat_Bran 25 3 1.00 0.50 \n",
+ "Cream_of_Wheat_(Quick) 0 2 1.00 1.00 \n",
+ "Crispix 25 3 1.00 1.00 \n",
+ "Crispy_Wheat_&_Raisins 25 3 1.00 0.75 \n",
+ "Double_Chex 25 3 1.00 0.75 \n",
+ "Froot_Loops 25 2 1.00 1.00 \n",
+ "Frosted_Flakes 25 1 1.00 0.75 \n",
+ "Frosted_Mini-Wheats 25 2 1.00 0.80 \n",
+ "Fruit_&_Fibre_Dates,_Walnuts,_and_Oats 25 3 1.25 0.67 \n",
+ "Fruitful_Bran 25 3 1.33 0.67 \n",
+ "Fruity_Pebbles 25 2 1.00 0.75 \n",
+ "... ... ... ... ... \n",
+ "Multi-Grain_Cheerios 25 1 1.00 1.00 \n",
+ "Nut&Honey_Crunch 25 2 1.00 0.67 \n",
+ "Nutri-Grain_Almond-Raisin 25 3 1.33 0.67 \n",
+ "Nutri-grain_Wheat 25 3 1.00 1.00 \n",
+ "Oatmeal_Raisin_Crisp 25 3 1.25 0.50 \n",
+ "Post_Nat._Raisin_Bran 25 3 1.33 0.67 \n",
+ "Product_19 100 3 1.00 1.00 \n",
+ "Puffed_Rice 0 3 0.50 1.00 \n",
+ "Puffed_Wheat 0 3 0.50 1.00 \n",
+ "Quaker_Oat_Squares 25 3 1.00 0.50 \n",
+ "Quaker_Oatmeal 0 1 1.00 0.67 \n",
+ "Raisin_Bran 25 2 1.33 0.75 \n",
+ "Raisin_Nut_Bran 25 3 1.00 0.50 \n",
+ "Raisin_Squares 25 3 1.00 0.50 \n",
+ "Rice_Chex 25 1 1.00 1.13 \n",
+ "Rice_Krispies 25 1 1.00 1.00 \n",
+ "Shredded_Wheat 0 1 0.83 1.00 \n",
+ "Shredded_Wheat_'n'Bran 0 1 1.00 0.67 \n",
+ "Shredded_Wheat_spoon_size 0 1 1.00 0.67 \n",
+ "Smacks 25 2 1.00 0.75 \n",
+ "Special_K 25 1 1.00 1.00 \n",
+ "Strawberry_Fruit_Wheats 25 2 1.00 1.00 \n",
+ "Total_Corn_Flakes 100 3 1.00 1.00 \n",
+ "Total_Raisin_Bran 100 3 1.50 1.00 \n",
+ "Total_Whole_Grain 100 3 1.00 1.00 \n",
+ "Triples 25 3 1.00 0.75 \n",
+ "Trix 25 2 1.00 1.00 \n",
+ "Wheat_Chex 25 1 1.00 0.67 \n",
+ "Wheaties 25 1 1.00 1.00 \n",
+ "Wheaties_Honey_Gold 25 1 1.00 0.75 \n",
+ "\n",
+ "[77 rows x 12 columns]"
+ ]
+ },
+ "execution_count": 60,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "normalize(filled_in_df_removed)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "ename": "SyntaxError",
+ "evalue": "invalid character in identifier (, line 1)",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;36m File \u001b[0;32m\"\"\u001b[0;36m, line \u001b[0;32m1\u001b[0m\n\u001b[0;31m df.div(df.cups, axis=“index”)`\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid character in identifier\n"
+ ]
+ }
+ ],
+ "source": [
+ "df.div(df.cups, axis=“index”)`"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "norm_df= filled_in_df_removed.div(df.cups, axis=\"index\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "norm_df.head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 62,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "processed = preprocessing.scale(norm_df)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 63,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([ 1.14734117, 3.42380788, 0.97072001, 1.32384857, 4.72937882,\n",
+ " -0.52840366, 1.51635962, 4.19746977, 1.45991832, 2.76273944,\n",
+ " 2.67555812, 0. ])"
+ ]
+ },
+ "execution_count": 63,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "processed[0]"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 71,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "KMeans(copy_x=True, init='k-means++', max_iter=300, n_clusters=3, n_init=10,\n",
+ " n_jobs=1, precompute_distances='auto', random_state=None, tol=0.0001,\n",
+ " verbose=0)"
+ ]
+ },
+ "execution_count": 71,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "k_means_method = KMeans(3)\n",
+ "k_means_method.fit(processed)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 79,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "three_clusters = k_means_method.predict(processed)\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 80,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "array([1, 0, 1, 1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0,\n",
+ " 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0,\n",
+ " 2, 0, 2, 2, 0, 2, 2, 0, 0, 0, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0,\n",
+ " 0, 2, 0, 0, 0, 0, 0, 0], dtype=int32)"
+ ]
+ },
+ "execution_count": 80,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "three_clusters\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 82,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "four_k_means = KMeans(4)\n",
+ "four_k_means.fit(processed)\n",
+ "four_clusters = four_k_means.predict(processed)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 83,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "five_k_means = KMeans(5)\n",
+ "five_k_means.fit(processed)\n",
+ "five_clusters = five_k_means.predict(processed)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 84,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": [
+ "six_k_means = KMeans(6)\n",
+ "six_k_means.fit(processed)\n",
+ "six_clusters = six_k_means.predict(processed)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 90,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "import matplotlib.pyplot as plt\n",
+ "import matplotlib\n",
+ "import numpy as np\n",
+ "import math\n",
+ "\n",
+ "from scipy.spatial import Voronoi, voronoi_plot_2d\n",
+ "%matplotlib inline\n",
+ "from sklearn.decomposition import PCA as PCA"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 97,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "ename": "TypeError",
+ "evalue": "'KMeans' object is not iterable",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mcereal_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpreprocessing\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mscale\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnorm_df\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mcentroids\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mclusters\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mKMeans\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mprocessed\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
+ "\u001b[0;31mTypeError\u001b[0m: 'KMeans' object is not iterable"
+ ]
+ }
+ ],
+ "source": [
+ "cereal_data = preprocessing.scale(norm_df)\n",
+ "centroids, clusters = KMeans(processed, 3)\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#Plotting (attempt)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 93,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "ename": "ValueError",
+ "evalue": "operands could not be broadcast together with shapes (1,77) (12,) ",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
+ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mpca\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mPCA\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_components\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnorm_df\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;31m#pca = processed\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mcentroids_2d\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpca\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtransform\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mthree_clusters\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mcolors\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"#E2415F\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"#7FAF1B\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"#090129\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0mmarkers\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m\"v\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"D\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"s\"\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;32m/Users/willflowers/Documents/The_Iron_Yard/python-assignments/honey-nut-clusters/.direnv/python-3.4.3/lib/python3.4/site-packages/sklearn/decomposition/pca.py\u001b[0m in \u001b[0;36mtransform\u001b[0;34m(self, X)\u001b[0m\n\u001b[1;32m 386\u001b[0m \u001b[0mX\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcheck_array\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 387\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean_\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 388\u001b[0;31m \u001b[0mX\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mX\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmean_\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 389\u001b[0m \u001b[0mX_transformed\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfast_dot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcomponents_\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 390\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwhiten\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0;31mValueError\u001b[0m: operands could not be broadcast together with shapes (1,77) (12,) "
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "pca = PCA(n_components=2).fit(cereals_data)\n",
+ "centroids_2d = pca.transform(centroids)\n",
+ "colors = [\"#E2415F\", \"#7FAF1B\", \"#090129\"]\n",
+ "markers = [\"v\", \"D\", \"s\"]\n",
+ "\n",
+ "plt.figure(figsize=(8, 6))\n",
+ "axes = plt.subplot(1,1,1)\n",
+ "\n",
+ "for i, cluster in enumerate(clusters):\n",
+ " cluster = np.array(cluster)\n",
+ " cluster_2d = pca.transform(cluster)\n",
+ " plt.scatter(cluster_2d[:,0], cluster_2d[:,1], color=colors[i])\n",
+ "\n",
+ "plt.scatter(centroids_2d[:, 0], centroids_2d[:, 1], color='g', alpha='0.5', marker='o', s=250)\n",
+ "\n",
+ "polys = voronoi_polygons(centroids_2d)\n",
+ "\n",
+ "for poly in polys:\n",
+ " p = matplotlib.patches.Polygon(poly, facecolor=np.random.rand(3,1), alpha=0.1)\n",
+ " axes.add_patch(p)\n",
+ " \n",
+ "plt.title(\"Iris dataset with three clusters\")\n",
+ "plt.show()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}