In [14]:
import pandas as pd
%matplotlib inline

In [15]:
simpsons = pd.read_csv("simpsons.csv")

In [16]:
simpsons


Out[16]:
person hair_length weight age class
0 Homer 0 240 36 M
1 Marge 10 150 34 F
2 Bart 2 90 10 M
3 Lisa 6 78 8 F
4 Maggie 4 20 1 F
5 Abe 1 170 70 M
6 Selma 8 160 41 F
7 Otto 10 180 38 M
8 Krusty 6 200 45 M
9 Comic 8 290 38 M

In [17]:
def gender_classifier(weight):
    if weight<=160:
        return "Female"
    else:
        return "Male"

In [18]:
gender_classifier(290)


Out[18]:
'Male'

In [ ]: