Skip to content

Instantly share code, notes, and snippets.

@onpillow
Created May 10, 2018 11:01
Show Gist options
  • Save onpillow/adbccf803ff26f723e84563ee86a07e1 to your computer and use it in GitHub Desktop.
Save onpillow/adbccf803ff26f723e84563ee86a07e1 to your computer and use it in GitHub Desktop.
for medium 01_01
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Import statements for all of the packages that I plan to use.\n",
"import pandas as pd\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"from collections import Counter\n",
"% matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>imdb_id</th>\n",
" <th>popularity</th>\n",
" <th>budget</th>\n",
" <th>revenue</th>\n",
" <th>original_title</th>\n",
" <th>cast</th>\n",
" <th>homepage</th>\n",
" <th>director</th>\n",
" <th>tagline</th>\n",
" <th>...</th>\n",
" <th>overview</th>\n",
" <th>runtime</th>\n",
" <th>genres</th>\n",
" <th>production_companies</th>\n",
" <th>release_date</th>\n",
" <th>vote_count</th>\n",
" <th>vote_average</th>\n",
" <th>release_year</th>\n",
" <th>budget_adj</th>\n",
" <th>revenue_adj</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>135397</td>\n",
" <td>tt0369610</td>\n",
" <td>32.985763</td>\n",
" <td>150000000</td>\n",
" <td>1513528810</td>\n",
" <td>Jurassic World</td>\n",
" <td>Chris Pratt|Bryce Dallas Howard|Irrfan Khan|Vi...</td>\n",
" <td>http://www.jurassicworld.com/</td>\n",
" <td>Colin Trevorrow</td>\n",
" <td>The park is open.</td>\n",
" <td>...</td>\n",
" <td>Twenty-two years after the events of Jurassic ...</td>\n",
" <td>124</td>\n",
" <td>Action|Adventure|Science Fiction|Thriller</td>\n",
" <td>Universal Studios|Amblin Entertainment|Legenda...</td>\n",
" <td>6/9/15</td>\n",
" <td>5562</td>\n",
" <td>6.5</td>\n",
" <td>2015</td>\n",
" <td>1.379999e+08</td>\n",
" <td>1.392446e+09</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>1 rows × 21 columns</p>\n",
"</div>"
],
"text/plain": [
" id imdb_id popularity budget revenue original_title \\\n",
"0 135397 tt0369610 32.985763 150000000 1513528810 Jurassic World \n",
"\n",
" cast \\\n",
"0 Chris Pratt|Bryce Dallas Howard|Irrfan Khan|Vi... \n",
"\n",
" homepage director tagline \\\n",
"0 http://www.jurassicworld.com/ Colin Trevorrow The park is open. \n",
"\n",
" ... overview runtime \\\n",
"0 ... Twenty-two years after the events of Jurassic ... 124 \n",
"\n",
" genres \\\n",
"0 Action|Adventure|Science Fiction|Thriller \n",
"\n",
" production_companies release_date vote_count \\\n",
"0 Universal Studios|Amblin Entertainment|Legenda... 6/9/15 5562 \n",
"\n",
" vote_average release_year budget_adj revenue_adj \n",
"0 6.5 2015 1.379999e+08 1.392446e+09 \n",
"\n",
"[1 rows x 21 columns]"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Load the data and print out a few lines. Perform operations to inspect data\n",
"# types and look for instances of missing or possibly errant data.\n",
"df = pd.read_csv('tmdb-movies (1).csv')\n",
"df.head(1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:py3]",
"language": "python",
"name": "conda-env-py3-py"
},
"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.6.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment