In [10]:
import pandas as pd
%matplotlib inline
from sklearn import datasets
from sklearn import tree
import matplotlib.pyplot as plt
import numpy as np

In [11]:
df = pd.read_excel("simpsons_data.xlsx")

In [12]:
df


Out[12]:
Person Hair Length Weight Age Class
0 Homer 0" 250 NaN M
1 Marge 10" 150 36.0 F
2 Bart 2" 90 34.0 M
3 Lisa 6" 78 10.0 F
4 Maggie 4" 20 8.0 F
5 Abe 1" 170 1.0 M
6 Selma 8" 160 70.0 F
7 Otto 10" 180 41.0 M
8 Krusty 6" 200 38.0 M
9 Comic 8" 290 45.0 ?

In [13]:
def simpson_characteristics(hair, weight, age):
    if weight >= 160:
        return "Female"
    else:
        return "Male"

In [ ]:


In [ ]: