Skip to content

Instantly share code, notes, and snippets.

@onpillow
Created May 11, 2018 03:24
Show Gist options
  • Save onpillow/f57b50c4d799de20bc4f9add685096b7 to your computer and use it in GitHub Desktop.
Save onpillow/f57b50c4d799de20bc4f9add685096b7 to your computer and use it in GitHub Desktop.
for medium01_4
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 452,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\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>30</th>\n",
" <td>280996</td>\n",
" <td>tt3168230</td>\n",
" <td>3.927333</td>\n",
" <td>0</td>\n",
" <td>29355203</td>\n",
" <td>Mr. Holmes</td>\n",
" <td>Ian McKellen|Milo Parker|Laura Linney|Hattie M...</td>\n",
" <td>http://www.mrholmesfilm.com/</td>\n",
" <td>Bill Condon</td>\n",
" <td>The man behind the myth</td>\n",
" <td>...</td>\n",
" <td>The story is set in 1947, following a long-ret...</td>\n",
" <td>103</td>\n",
" <td>Mystery|Drama</td>\n",
" <td>BBC Films|See-Saw Films|FilmNation Entertainme...</td>\n",
" <td>6/19/15</td>\n",
" <td>425</td>\n",
" <td>6.4</td>\n",
" <td>2015</td>\n",
" <td>0.0</td>\n",
" <td>2.700677e+07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>36</th>\n",
" <td>339527</td>\n",
" <td>tt1291570</td>\n",
" <td>3.358321</td>\n",
" <td>0</td>\n",
" <td>22354572</td>\n",
" <td>Solace</td>\n",
" <td>Abbie Cornish|Jeffrey Dean Morgan|Colin Farrel...</td>\n",
" <td>NaN</td>\n",
" <td>Afonso Poyart</td>\n",
" <td>A serial killer who can see your future, a psy...</td>\n",
" <td>...</td>\n",
" <td>A psychic doctor, John Clancy, works with an F...</td>\n",
" <td>101</td>\n",
" <td>Crime|Drama|Mystery</td>\n",
" <td>Eden Rock Media|FilmNation Entertainment|Flynn...</td>\n",
" <td>9/3/15</td>\n",
" <td>474</td>\n",
" <td>6.2</td>\n",
" <td>2015</td>\n",
" <td>0.0</td>\n",
" <td>2.056620e+07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>72</th>\n",
" <td>284289</td>\n",
" <td>tt2911668</td>\n",
" <td>2.272044</td>\n",
" <td>0</td>\n",
" <td>45895</td>\n",
" <td>Beyond the Reach</td>\n",
" <td>Michael Douglas|Jeremy Irvine|Hanna Mangan Law...</td>\n",
" <td>NaN</td>\n",
" <td>Jean-Baptiste Léonetti</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>A high-rolling corporate shark and his impover...</td>\n",
" <td>95</td>\n",
" <td>Thriller</td>\n",
" <td>Furthur Films</td>\n",
" <td>4/17/15</td>\n",
" <td>81</td>\n",
" <td>5.5</td>\n",
" <td>2015</td>\n",
" <td>0.0</td>\n",
" <td>4.222338e+04</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>3 rows × 21 columns</p>\n",
"</div>"
],
"text/plain": [
" id imdb_id popularity budget revenue original_title \\\n",
"30 280996 tt3168230 3.927333 0 29355203 Mr. Holmes \n",
"36 339527 tt1291570 3.358321 0 22354572 Solace \n",
"72 284289 tt2911668 2.272044 0 45895 Beyond the Reach \n",
"\n",
" cast \\\n",
"30 Ian McKellen|Milo Parker|Laura Linney|Hattie M... \n",
"36 Abbie Cornish|Jeffrey Dean Morgan|Colin Farrel... \n",
"72 Michael Douglas|Jeremy Irvine|Hanna Mangan Law... \n",
"\n",
" homepage director \\\n",
"30 http://www.mrholmesfilm.com/ Bill Condon \n",
"36 NaN Afonso Poyart \n",
"72 NaN Jean-Baptiste Léonetti \n",
"\n",
" tagline ... \\\n",
"30 The man behind the myth ... \n",
"36 A serial killer who can see your future, a psy... ... \n",
"72 NaN ... \n",
"\n",
" overview runtime \\\n",
"30 The story is set in 1947, following a long-ret... 103 \n",
"36 A psychic doctor, John Clancy, works with an F... 101 \n",
"72 A high-rolling corporate shark and his impover... 95 \n",
"\n",
" genres production_companies \\\n",
"30 Mystery|Drama BBC Films|See-Saw Films|FilmNation Entertainme... \n",
"36 Crime|Drama|Mystery Eden Rock Media|FilmNation Entertainment|Flynn... \n",
"72 Thriller Furthur Films \n",
"\n",
" release_date vote_count vote_average release_year budget_adj \\\n",
"30 6/19/15 425 6.4 2015 0.0 \n",
"36 9/3/15 474 6.2 2015 0.0 \n",
"72 4/17/15 81 5.5 2015 0.0 \n",
"\n",
" revenue_adj \n",
"30 2.700677e+07 \n",
"36 2.056620e+07 \n",
"72 4.222338e+04 \n",
"\n",
"[3 rows x 21 columns]"
]
},
"execution_count": 452,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#filter the zero budget data\n",
"df_budget_zero = df.query('budget == 0')\n",
"# choice the first three randomly\n",
"df_budget_zero.head(3)"
]
},
{
"cell_type": "code",
"execution_count": 453,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style>\n",
" .dataframe thead tr:only-child th {\n",
" text-align: right;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: left;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\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>48</th>\n",
" <td>265208</td>\n",
" <td>tt2231253</td>\n",
" <td>2.932340</td>\n",
" <td>30000000</td>\n",
" <td>0</td>\n",
" <td>Wild Card</td>\n",
" <td>Jason Statham|Michael Angarano|Milo Ventimigli...</td>\n",
" <td>NaN</td>\n",
" <td>Simon West</td>\n",
" <td>Never bet against a man with a killer hand.</td>\n",
" <td>...</td>\n",
" <td>When a Las Vegas bodyguard with lethal skills ...</td>\n",
" <td>92</td>\n",
" <td>Thriller|Crime|Drama</td>\n",
" <td>Current Entertainment|Lionsgate|Sierra / Affin...</td>\n",
" <td>1/14/15</td>\n",
" <td>481</td>\n",
" <td>5.3</td>\n",
" <td>2015</td>\n",
" <td>2.759999e+07</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>67</th>\n",
" <td>334074</td>\n",
" <td>tt3247714</td>\n",
" <td>2.331636</td>\n",
" <td>20000000</td>\n",
" <td>0</td>\n",
" <td>Survivor</td>\n",
" <td>Pierce Brosnan|Milla Jovovich|Dylan McDermott|...</td>\n",
" <td>http://survivormovie.com/</td>\n",
" <td>James McTeigue</td>\n",
" <td>His Next Target is Now Hunting Him</td>\n",
" <td>...</td>\n",
" <td>A Foreign Service Officer in London tries to p...</td>\n",
" <td>96</td>\n",
" <td>Crime|Thriller|Action</td>\n",
" <td>Nu Image Films|Winkler Films|Millennium Films|...</td>\n",
" <td>5/21/15</td>\n",
" <td>280</td>\n",
" <td>5.4</td>\n",
" <td>2015</td>\n",
" <td>1.839999e+07</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>74</th>\n",
" <td>347096</td>\n",
" <td>tt3478232</td>\n",
" <td>2.165433</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>Mythica: The Darkspore</td>\n",
" <td>Melanie Stone|Kevin Sorbo|Adam Johnson|Jake St...</td>\n",
" <td>http://www.mythicamovie.com/#!blank/wufvh</td>\n",
" <td>Anne K. Black</td>\n",
" <td>NaN</td>\n",
" <td>...</td>\n",
" <td>When Teela’s sister is murdered and a powerf...</td>\n",
" <td>108</td>\n",
" <td>Action|Adventure|Fantasy</td>\n",
" <td>Arrowstorm Entertainment</td>\n",
" <td>6/24/15</td>\n",
" <td>27</td>\n",
" <td>5.1</td>\n",
" <td>2015</td>\n",
" <td>0.000000e+00</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>3 rows × 21 columns</p>\n",
"</div>"
],
"text/plain": [
" id imdb_id popularity budget revenue original_title \\\n",
"48 265208 tt2231253 2.932340 30000000 0 Wild Card \n",
"67 334074 tt3247714 2.331636 20000000 0 Survivor \n",
"74 347096 tt3478232 2.165433 0 0 Mythica: The Darkspore \n",
"\n",
" cast \\\n",
"48 Jason Statham|Michael Angarano|Milo Ventimigli... \n",
"67 Pierce Brosnan|Milla Jovovich|Dylan McDermott|... \n",
"74 Melanie Stone|Kevin Sorbo|Adam Johnson|Jake St... \n",
"\n",
" homepage director \\\n",
"48 NaN Simon West \n",
"67 http://survivormovie.com/ James McTeigue \n",
"74 http://www.mythicamovie.com/#!blank/wufvh Anne K. Black \n",
"\n",
" tagline ... \\\n",
"48 Never bet against a man with a killer hand. ... \n",
"67 His Next Target is Now Hunting Him ... \n",
"74 NaN ... \n",
"\n",
" overview runtime \\\n",
"48 When a Las Vegas bodyguard with lethal skills ... 92 \n",
"67 A Foreign Service Officer in London tries to p... 96 \n",
"74 When Teela’s sister is murdered and a powerf... 108 \n",
"\n",
" genres \\\n",
"48 Thriller|Crime|Drama \n",
"67 Crime|Thriller|Action \n",
"74 Action|Adventure|Fantasy \n",
"\n",
" production_companies release_date vote_count \\\n",
"48 Current Entertainment|Lionsgate|Sierra / Affin... 1/14/15 481 \n",
"67 Nu Image Films|Winkler Films|Millennium Films|... 5/21/15 280 \n",
"74 Arrowstorm Entertainment 6/24/15 27 \n",
"\n",
" vote_average release_year budget_adj revenue_adj \n",
"48 5.3 2015 2.759999e+07 0.0 \n",
"67 5.4 2015 1.839999e+07 0.0 \n",
"74 5.1 2015 0.000000e+00 0.0 \n",
"\n",
"[3 rows x 21 columns]"
]
},
"execution_count": 453,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#filter the zero revenue data\n",
"df_revenue_zero = df.query('revenue == 0')\n",
"# choice the first three randomly\n",
"df_revenue_zero.head(3)"
]
}
],
"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