Boolean indexing for fun, profit, and the pursuit of happiness

In [ ]:
%matplotlib inline
from IPython.display import Image
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
In [ ]:
user_labels=["user_id", "age", "gender","occupation","zip_code"]
In [ ]:
users=pd.read_csv('./ml-100k/u.user', sep="|", names=user_labels, index_col="user_id", nrows=12) #we'll unpack this later
In [ ]:
#start here
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
 
In [ ]:
#may use later in the class
labels_films=["movie_id", "movie_title", "release_date", "video_release_date", "IMDb_URL", "unknown", "Action","Adventure", "Animation", "Children's", "Comedy", "Crime", "Documentary", "Drama", "Fantasy", "Film-Noir", "Horror", "Musical", "Mystery", "Romance", "Sci-Fi", "Thriller", "War", "Western"]
films=pd.read_csv( './ml-100k/u.item', sep="|", names=labels_films, index_col='movie_id')