{ "metadata": { "name": "05 boolean_practice" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": "#Boolean indexing for fun, profit, and the pursuit of happiness" }, { "cell_type": "code", "collapsed": false, "input": "%matplotlib inline\nfrom IPython.display import Image\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "user_labels=[\"user_id\", \"age\", \"gender\",\"occupation\",\"zip_code\"]", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "users=pd.read_csv('./ml-100k/u.user', sep=\"|\", names=user_labels, index_col=\"user_id\", nrows=12) #we'll unpack this later", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "#start here", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "", "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": "#may use later in the class\nlabels_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\"]\nfilms=pd.read_csv( './ml-100k/u.item', sep=\"|\", names=labels_films, index_col='movie_id')", "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }