From 7affb6db3d4b33ed7dc2174f7a31db6cd5388da9 Mon Sep 17 00:00:00 2001 From: Walker Waylon Scott Date: Thu, 29 Jun 2017 23:10:18 -0500 Subject: [PATCH] Initial commit of app --- README.md | 14 +- notebooks/Explore Movie Dataset.ipynb | 11828 +++++++++++++++++++++++- src/pyDataVizDay.py | 39 + src/templates/enthusiast.html | 2 + src/templates/index.html | 2 + src/templates/investor.html | 2 + src/templates/layout.html | 40 + src/templates/pyDataVizDay.py | 32 + 8 files changed, 11870 insertions(+), 89 deletions(-) create mode 100644 src/pyDataVizDay.py create mode 100644 src/templates/enthusiast.html create mode 100644 src/templates/index.html create mode 100644 src/templates/investor.html create mode 100644 src/templates/layout.html create mode 100644 src/templates/pyDataVizDay.py diff --git a/README.md b/README.md index ee779f6..5ae50c0 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This project will be using the Kaggle |----|---------|-------------------|--------------------------|------------|---------------------------|--------------------------|------------------|--------------------------|---------------|---------------------------------|-----------------|--------------------------------------------|-------------------|-----------------------------|----------------------|------------------------|------------------------------------------------------------------|------------------------------------------------------|------------------------|------------|-----------|------------------|------------|--------------|--------------------------|--------------|----------------|------------------------| | 0 | Color | James Cameron | 723 | 178 | 0 | 855 | Joel David Moore | 1000 | 7.60506e+08 | Action/Adventure/Fantasy/Sci-Fi | CCH Pounder | Avatar | 886204 | 4834 | Wes Studi | 0 | avatar/future/marine/native/paraplegic | http://www.imdb.com/title/tt0499549/?ref_=fn_tt_tt_1 | 3054 | English | USA | PG-13 | 2.37e+08 | 2009 | 936 | 7.9 | 1.78 | 33000 | | 1 | Color | Gore Verbinski | 302 | 169 | 563 | 1000 | Orlando Bloom | 40000 | 3.09404e+08 | Action/Adventure/Fantasy | Johnny Depp | Pirates of the Caribbean- At World's End | 471220 | 48350 | Jack Davenport | 0 | goddess/marriage ceremony/marriage proposal/pirate/singapore | http://www.imdb.com/title/tt0449088/?ref_=fn_tt_tt_1 | 1238 | English | USA | PG-13 | 3e+08 | 2007 | 5000 | 7.1 | 2.35 | 0 | -| 2 | Color | Sam Mendes | 602 | 148 | 0 | 161 | Rory Kinnear | 11000 | 2.00074e+08 | Action/Adventure/Thriller | Christoph Waltz | Spectre | 275868 | 11700 | Stephanie Sigman | 1 | bomb|espionage/sequel/spy/terrorist | http://www.imdb.com/title/tt2379713/?ref_=fn_tt_tt_1 | 994 | English | UK | PG-13 | 2.45e+08 | 2015 | 393 | 6.8 | 2.35 | 85000 | +| 2 | Color | Sam Mendes | 602 | 148 | 0 | 161 | Rory Kinnear | 11000 | 2.00074e+08 | Action/Adventure/Thriller | Christoph Waltz | Spectre | 275868 | 11700 | Stephanie Sigman | 1 | bomb/espionage/sequel/spy/terrorist | http://www.imdb.com/title/tt2379713/?ref_=fn_tt_tt_1 | 994 | English | UK | PG-13 | 2.45e+08 | 2015 | 393 | 6.8 | 2.35 | 85000 | | 3 | Color | Christopher Nolan | 813 | 164 | 22000 | 23000 | Christian Bale | 27000 | 4.48131e+08 | Action/Thriller | Tom Hardy | The Dark Knight Rises | 1144337 | 106759 | Joseph Gordon-Levitt | 0 | deception/imprisonment/lawlessness/police officer/terrorist plot | http://www.imdb.com/title/tt1345836/?ref_=fn_tt_tt_1 | 2701 | English | USA | PG-13 | 2.5e+08 | 2012 | 23000 | 8.5 | 2.35 | 164000 | | 4 | nan | Doug Walker | nan | nan | 131 | nan | Rob Walker | 131 | nan | Documentary | Doug Walker | Star Wars: Episode VII - The Force Awakens | 8 | 143 | nan | 0 | nan | http://www.imdb.com/title/tt5289954/?ref_=fn_tt_tt_1 | nan | nan | nan | nan | nan | nan | 12 | 7.1 | nan | 0 | @@ -43,3 +43,15 @@ This is the wireframe that the team has been given to replicate in python using ![dashboard](./wireframe/DashboardMock-up-01.jpg) + +## Time Investment + +* **5 min** ETL + * initial creation(modified personal file) +* **5 min** settings.py + * 5 minute (modified personal file) +* **20 min** setup initial layout.html, index, and first two "story".html pages + * found decent bootstrap layout template online + * first time following the Flask Active button tutorial + * http://jinja.pocoo.org/docs/2.9/tricks/ + diff --git a/notebooks/Explore Movie Dataset.ipynb b/notebooks/Explore Movie Dataset.ipynb index fc35c86..8701dfa 100644 --- a/notebooks/Explore Movie Dataset.ipynb +++ b/notebooks/Explore Movie Dataset.ipynb @@ -2,7 +2,25 @@ "cells": [ { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 0, + "height": 11, + "hidden": false, + "row": 0, + "width": 6 + }, + "report_default": { + "hidden": true + } + } + } + } + }, "source": [ "## Explore Movie Dataset" ] @@ -10,13 +28,31 @@ { "cell_type": "code", "execution_count": 1, - "metadata": {}, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 4, + "height": 10, + "hidden": false, + "row": 11, + "width": 4 + }, + "report_default": { + "hidden": true + } + } + } + } + }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "2017-06-26 18:57:49 \n", + "2017-06-29 08:29:53 \n", "\n", "CPython 3.6.1\n", "IPython 6.1.0\n", @@ -50,7 +86,20 @@ "cell_type": "code", "execution_count": 2, "metadata": { - "collapsed": true + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } }, "outputs": [], "source": [ @@ -60,7 +109,25 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 8, + "height": 4, + "hidden": false, + "row": 0, + "width": 4 + }, + "report_default": { + "hidden": true + } + } + } + } + }, "source": [ "## Available Columns" ] @@ -68,7 +135,25 @@ { "cell_type": "code", "execution_count": 3, - "metadata": {}, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 0, + "height": 11, + "hidden": false, + "row": 11, + "width": 4 + }, + "report_default": { + "hidden": true + } + } + } + } + }, "outputs": [ { "data": { @@ -95,7 +180,824 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 8, + "height": 4, + "hidden": false, + "row": 4, + "width": 4 + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "source": [ + "### Add Calulations to etl" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 8, + "height": 17, + "hidden": false, + "row": 8, + "width": 4 + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "color object\n", + "director_name object\n", + "num_critic_for_reviews float64\n", + "duration float64\n", + "director_facebook_likes float64\n", + "actor_3_facebook_likes float64\n", + "actor_2_name object\n", + "actor_1_facebook_likes float64\n", + "gross float64\n", + "genres object\n", + "actor_1_name object\n", + "movie_title object\n", + "num_voted_users int64\n", + "cast_total_facebook_likes int64\n", + "actor_3_name object\n", + "facenumber_in_poster float64\n", + "plot_keywords object\n", + "movie_imdb_link object\n", + "num_user_for_reviews float64\n", + "language object\n", + "country object\n", + "content_rating object\n", + "budget float64\n", + "title_year float64\n", + "actor_2_facebook_likes float64\n", + "imdb_score float64\n", + "aspect_ratio float64\n", + "movie_facebook_likes int64\n", + "dtype: object" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data.movie.dtypes" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "outputs": [], + "source": [ + "data.movie['net'] = data.movie['gross'] - data.movie['budget']" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 0, + "height": 79, + "hidden": false, + "row": 25, + "width": 5 + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
movie_titletitle_yearbudgetgrossnet
2988The Host2006.01.221550e+102201412.0-1.221330e+10
3859Lady Vengeance2005.04.200000e+09211667.0-4.199788e+09
3005Fateless2005.02.500000e+09195888.0-2.499804e+09
2323Princess Mononoke1997.02.400000e+092298191.0-2.397702e+09
2334Steamboy2004.02.127520e+09410388.0-2.127110e+09
3423Akira1988.01.100000e+09439162.0-1.099561e+09
4542Godzilla 20001999.01.000000e+0910037390.0-9.899626e+08
3075Kabhi Alvida Naa Kehna2006.07.000000e+083275443.0-6.967246e+08
3851Tango1998.07.000000e+081687311.0-6.983127e+08
3273Kites2010.06.000000e+081602466.0-5.983975e+08
1338Red Cliff2008.05.536320e+08626809.0-5.530052e+08
3311The Legend of Suriyothai2001.04.000000e+08454255.0-3.995457e+08
1016The Messenger: The Story of Joan of Arc1999.03.900000e+0814131298.0-3.758687e+08
2740Ong-bak 22008.03.000000e+08102055.0-2.998979e+08
1Pirates of the Caribbean: At World's End2007.03.000000e+08309404152.09.404152e+06
5John Carter2012.02.637000e+0873058679.0-1.906413e+08
7Tangled2010.02.600000e+08200807262.0-5.919274e+07
6Spider-Man 32007.02.580000e+08336530303.07.853030e+07
3461Spider-Man 32007.02.580000e+08336530303.07.853030e+07
10Batman v Superman: Dawn of Justice2016.02.500000e+08330249062.08.024906e+07
9Harry Potter and the Half-Blood Prince2009.02.500000e+08301956980.05.195698e+07
8Avengers: Age of Ultron2015.02.500000e+08458991599.02.089916e+08
18Pirates of the Caribbean: On Stranger Tides2011.02.500000e+08241063875.0-8.936125e+06
20The Hobbit: The Battle of the Five Armies2014.02.500000e+08255108370.05.108370e+06
3The Dark Knight Rises2012.02.500000e+08448130642.01.981306e+08
27Captain America: Civil War2016.02.500000e+08407197282.01.571973e+08
2Spectre2015.02.450000e+08200074175.0-4.492582e+07
0Avatar2009.02.370000e+08760505847.05.235058e+08
21The Amazing Spider-Man2012.02.300000e+08262030663.03.203066e+07
15Man of Steel2013.02.250000e+08291021565.06.602156e+07
..................
490232010.0NaN59774.0NaN
4909Baghead2008.0NaN140016.0NaN
4910Solitude2014.0NaNNaNNaN
4912Ordet1955.0NaNNaNNaN
4913Good Dick2008.0NaN15542.0NaN
4919H.2014.0NaNNaNNaN
4927The Calling2014.0NaNNaNNaN
4934When the Lights Went Out2012.0NaNNaNNaN
4935Heroes of Dirt2015.0NaNNaNNaN
4944Sound of My Voice2011.0NaN405614.0NaN
4960The Mighty1998.0NaN2643689.0NaN
4967Open Secret1948.0NaNNaNNaN
4969The Night Visitor1971.0NaNNaNNaN
4974I Love You, Don't Touch Me!1997.0NaN33598.0NaN
4982Supporting Characters2012.0NaNNaNNaN
4985The Dirties2013.0NaNNaNNaN
4986Gabriela1983.0NaNNaNNaN
4989The Naked Ape2006.0NaNNaNNaN
5001The Last Waltz1978.0NaN321952.0NaN
5003The Exploding Girl2009.0NaN24705.0NaN
5005Mutual Appreciation2005.0NaNNaNNaN
5007Down Terrace2009.0NaN9609.0NaN
5010Funny Ha Ha2002.0NaNNaNNaN
5014Rampage2009.0NaNNaNNaN
5019Exeter2015.0NaNNaNNaN
5030On the Downlow2004.0NaNNaNNaN
5032Bang1995.0NaNNaNNaN
5038Signed Sealed Delivered2013.0NaNNaNNaN
5039The FollowingNaNNaNNaNNaN
5041Shanghai Calling2012.0NaN10443.0NaN
\n", + "

5043 rows × 5 columns

\n", + "
" + ], + "text/plain": [ + " movie_title title_year budget \\\n", + "2988 The Host  2006.0 1.221550e+10 \n", + "3859 Lady Vengeance  2005.0 4.200000e+09 \n", + "3005 Fateless  2005.0 2.500000e+09 \n", + "2323 Princess Mononoke  1997.0 2.400000e+09 \n", + "2334 Steamboy  2004.0 2.127520e+09 \n", + "3423 Akira  1988.0 1.100000e+09 \n", + "4542 Godzilla 2000  1999.0 1.000000e+09 \n", + "3075 Kabhi Alvida Naa Kehna  2006.0 7.000000e+08 \n", + "3851 Tango  1998.0 7.000000e+08 \n", + "3273 Kites  2010.0 6.000000e+08 \n", + "1338 Red Cliff  2008.0 5.536320e+08 \n", + "3311 The Legend of Suriyothai  2001.0 4.000000e+08 \n", + "1016 The Messenger: The Story of Joan of Arc  1999.0 3.900000e+08 \n", + "2740 Ong-bak 2  2008.0 3.000000e+08 \n", + "1 Pirates of the Caribbean: At World's End  2007.0 3.000000e+08 \n", + "5 John Carter  2012.0 2.637000e+08 \n", + "7 Tangled  2010.0 2.600000e+08 \n", + "6 Spider-Man 3  2007.0 2.580000e+08 \n", + "3461 Spider-Man 3  2007.0 2.580000e+08 \n", + "10 Batman v Superman: Dawn of Justice  2016.0 2.500000e+08 \n", + "9 Harry Potter and the Half-Blood Prince  2009.0 2.500000e+08 \n", + "8 Avengers: Age of Ultron  2015.0 2.500000e+08 \n", + "18 Pirates of the Caribbean: On Stranger Tides  2011.0 2.500000e+08 \n", + "20 The Hobbit: The Battle of the Five Armies  2014.0 2.500000e+08 \n", + "3 The Dark Knight Rises  2012.0 2.500000e+08 \n", + "27 Captain America: Civil War  2016.0 2.500000e+08 \n", + "2 Spectre  2015.0 2.450000e+08 \n", + "0 Avatar  2009.0 2.370000e+08 \n", + "21 The Amazing Spider-Man  2012.0 2.300000e+08 \n", + "15 Man of Steel  2013.0 2.250000e+08 \n", + "... ... ... ... \n", + "4902 3  2010.0 NaN \n", + "4909 Baghead  2008.0 NaN \n", + "4910 Solitude  2014.0 NaN \n", + "4912 Ordet  1955.0 NaN \n", + "4913 Good Dick  2008.0 NaN \n", + "4919 H.  2014.0 NaN \n", + "4927 The Calling  2014.0 NaN \n", + "4934 When the Lights Went Out  2012.0 NaN \n", + "4935 Heroes of Dirt  2015.0 NaN \n", + "4944 Sound of My Voice  2011.0 NaN \n", + "4960 The Mighty  1998.0 NaN \n", + "4967 Open Secret  1948.0 NaN \n", + "4969 The Night Visitor  1971.0 NaN \n", + "4974 I Love You, Don't Touch Me!  1997.0 NaN \n", + "4982 Supporting Characters  2012.0 NaN \n", + "4985 The Dirties  2013.0 NaN \n", + "4986 Gabriela  1983.0 NaN \n", + "4989 The Naked Ape  2006.0 NaN \n", + "5001 The Last Waltz  1978.0 NaN \n", + "5003 The Exploding Girl  2009.0 NaN \n", + "5005 Mutual Appreciation  2005.0 NaN \n", + "5007 Down Terrace  2009.0 NaN \n", + "5010 Funny Ha Ha  2002.0 NaN \n", + "5014 Rampage  2009.0 NaN \n", + "5019 Exeter  2015.0 NaN \n", + "5030 On the Downlow  2004.0 NaN \n", + "5032 Bang  1995.0 NaN \n", + "5038 Signed Sealed Delivered  2013.0 NaN \n", + "5039 The Following  NaN NaN \n", + "5041 Shanghai Calling  2012.0 NaN \n", + "\n", + " gross net \n", + "2988 2201412.0 -1.221330e+10 \n", + "3859 211667.0 -4.199788e+09 \n", + "3005 195888.0 -2.499804e+09 \n", + "2323 2298191.0 -2.397702e+09 \n", + "2334 410388.0 -2.127110e+09 \n", + "3423 439162.0 -1.099561e+09 \n", + "4542 10037390.0 -9.899626e+08 \n", + "3075 3275443.0 -6.967246e+08 \n", + "3851 1687311.0 -6.983127e+08 \n", + "3273 1602466.0 -5.983975e+08 \n", + "1338 626809.0 -5.530052e+08 \n", + "3311 454255.0 -3.995457e+08 \n", + "1016 14131298.0 -3.758687e+08 \n", + "2740 102055.0 -2.998979e+08 \n", + "1 309404152.0 9.404152e+06 \n", + "5 73058679.0 -1.906413e+08 \n", + "7 200807262.0 -5.919274e+07 \n", + "6 336530303.0 7.853030e+07 \n", + "3461 336530303.0 7.853030e+07 \n", + "10 330249062.0 8.024906e+07 \n", + "9 301956980.0 5.195698e+07 \n", + "8 458991599.0 2.089916e+08 \n", + "18 241063875.0 -8.936125e+06 \n", + "20 255108370.0 5.108370e+06 \n", + "3 448130642.0 1.981306e+08 \n", + "27 407197282.0 1.571973e+08 \n", + "2 200074175.0 -4.492582e+07 \n", + "0 760505847.0 5.235058e+08 \n", + "21 262030663.0 3.203066e+07 \n", + "15 291021565.0 6.602156e+07 \n", + "... ... ... \n", + "4902 59774.0 NaN \n", + "4909 140016.0 NaN \n", + "4910 NaN NaN \n", + "4912 NaN NaN \n", + "4913 15542.0 NaN \n", + "4919 NaN NaN \n", + "4927 NaN NaN \n", + "4934 NaN NaN \n", + "4935 NaN NaN \n", + "4944 405614.0 NaN \n", + "4960 2643689.0 NaN \n", + "4967 NaN NaN \n", + "4969 NaN NaN \n", + "4974 33598.0 NaN \n", + "4982 NaN NaN \n", + "4985 NaN NaN \n", + "4986 NaN NaN \n", + "4989 NaN NaN \n", + "5001 321952.0 NaN \n", + "5003 24705.0 NaN \n", + "5005 NaN NaN \n", + "5007 9609.0 NaN \n", + "5010 NaN NaN \n", + "5014 NaN NaN \n", + "5019 NaN NaN \n", + "5030 NaN NaN \n", + "5032 NaN NaN \n", + "5038 NaN NaN \n", + "5039 NaN NaN \n", + "5041 10443.0 NaN \n", + "\n", + "[5043 rows x 5 columns]" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data.movie.sort_values('budget',ascending=False)[['movie_title', 'title_year', 'budget', 'gross', 'net']]" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 0, + "height": 4, + "hidden": false, + "row": 104, + "width": 12 + }, + "report_default": { + "hidden": true + } + } + } + } + }, "source": [ "## plotting with IPlotter\n", "\n", @@ -104,9 +1006,22 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": { - "collapsed": true + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } }, "outputs": [], "source": [ @@ -115,9 +1030,22 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 8, "metadata": { - "collapsed": true + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } }, "outputs": [], "source": [ @@ -126,15 +1054,51 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 4, + "height": 4, + "hidden": false, + "row": 21, + "width": 4 + }, + "report_default": { + "hidden": false + } + } + } + } + }, "source": [ "### Timeseries of mean gross" ] }, { "cell_type": "code", - "execution_count": 46, - "metadata": {}, + "execution_count": 9, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 0, + "height": 15, + "hidden": false, + "row": 108, + "width": 9 + }, + "report_default": { + "hidden": false + } + } + } + } + }, "outputs": [ { "data": { @@ -161,6 +1125,8 @@ " 'type': 'line',\n", " 'axes': {\n", " 'gross': 'y',\n", + " 'net': 'y',\n", + " 'budget': 'y',\n", " 'x': 'y'\n", " },\n", " 'columns': [\n", @@ -170,7 +1136,7 @@ " 3000000.0,\n", " 0.0,\n", " 26435.0,\n", - " 1408975.0,\n", + " 9950.0,\n", " 0.0,\n", " 0.0,\n", " 2300000.0,\n", @@ -179,22 +1145,22 @@ " 163245.0,\n", " 184925485.0,\n", " 0.0,\n", - " 110428945.0,\n", - " 80350000.0,\n", + " 22202612.0,\n", + " 76400000.0,\n", " 0.0,\n", " 102797150.0,\n", " 0.0,\n", " 0.0,\n", " 0.0,\n", - " 22025000.0,\n", + " 20400000.0,\n", " 7927.0,\n", " 2956000.0,\n", " 0.0,\n", " 8000000.0,\n", " 0.0,\n", " 36000000.0,\n", - " 20500000.0,\n", - " 4934530.5,\n", + " 5000000.0,\n", + " 269061.0,\n", " 0.0,\n", " 0.0,\n", " 27200000.0,\n", @@ -202,61 +1168,249 @@ " 25000000.0,\n", " 32000000.0,\n", " 43650000.0,\n", - " 11033517.5,\n", - " 42950000.0,\n", - " 38237907.166666664,\n", - " 69310231.8,\n", + " 6000000.0,\n", + " 24800000.0,\n", + " 12438.0,\n", + " 14873.0,\n", " 6100000.0,\n", " 43100000.0,\n", - " 36757685.5,\n", - " 41711931.0,\n", - " 10450000.0,\n", - " 27247057.75,\n", - " 67501217.5,\n", - " 102919529.0,\n", - " 55052942.85714286,\n", - " 124409732.33333333,\n", - " 71117623.5,\n", - " 106290809.28571428,\n", - " 71542234.6,\n", - " 63579571.428571425,\n", - " 57697266.733333334,\n", - " 41460781.52941176,\n", - " 75037552.1875,\n", - " 70192386.35714285,\n", - " 62939598.73913044,\n", - " 59223134.13333333,\n", - " 44436464.04,\n", - " 40233264.77419355,\n", - " 41190351.833333336,\n", - " 49678453.15151515,\n", - " 78203971.25,\n", - " 53844501.666666664,\n", - " 63665195.14705882,\n", - " 45302091.41304348,\n", - " 59395666.16981132,\n", - " 44909519.98550725,\n", - " 42044174.25263158,\n", - " 44793772.43103448,\n", - " 38377007.96124031,\n", - " 38072176.27710843,\n", - " 42172627.58083832,\n", - " 43255716.92553192,\n", - " 43511151.485,\n", - " 48727746.72327044,\n", - " 40726529.11,\n", - " 41159143.29064039,\n", - " 39237855.9537037,\n", - " 46267501.02234637,\n", - " 44573509.378109455,\n", - " 46207440.2,\n", - " 49908326.01005025,\n", - " 45785836.64397906,\n", - " 62873527.67955801,\n", - " 56158357.77540107,\n", - " 62412136.94610778,\n", - " 66530966.47552448,\n", - " 76924035.8918919\n", + " 16800000.0,\n", + " 26893.0,\n", + " 5000000.0,\n", + " 8231.0,\n", + " 180483.0,\n", + " 32645.0,\n", + " 21000000.0,\n", + " 1229197.0,\n", + " 25000000.0,\n", + " 1000000.0,\n", + " 321952.0,\n", + " 29200000.0,\n", + " 45250.0,\n", + " 126387.0,\n", + " 5333658.0,\n", + " 12200000.0,\n", + " 5100000.0,\n", + " 4250320.0,\n", + " 1953732.0,\n", + " 354704.0,\n", + " 439162.0,\n", + " 792966.0,\n", + " 333658.0,\n", + " 869325.0,\n", + " 1100000.0,\n", + " 48856.0,\n", + " 125169.0,\n", + " 529766.0,\n", + " 22434.0,\n", + " 5494.0,\n", + " 10508.0,\n", + " 7680.0,\n", + " 5725.0,\n", + " 703.0,\n", + " 13134.0,\n", + " 2580.0,\n", + " 5199.0,\n", + " 12667.0,\n", + " 721.0,\n", + " 5561.0,\n", + " 3478.0,\n", + " 828.0,\n", + " 12561.0,\n", + " 2245.0,\n", + " 1332.0,\n", + " 2843.0,\n", + " 162.0,\n", + " 1711.0,\n", + " 31662.0\n", + " ],\n", + " [\n", + " 'net',\n", + " 0.0,\n", + " 2900000.0,\n", + " 0.0,\n", + " -5973565.0,\n", + " 2429000.0,\n", + " 0.0,\n", + " 0.0,\n", + " 1861000.0,\n", + " 0.0,\n", + " 2391000.0,\n", + " -1336755.0,\n", + " 182925485.0,\n", + " 0.0,\n", + " 19402612.0,\n", + " 74120000.0,\n", + " 0.0,\n", + " 0.0,\n", + " 0.0,\n", + " 0.0,\n", + " 0.0,\n", + " 12400000.0,\n", + " -2292073.0,\n", + " -744000.0,\n", + " 0.0,\n", + " 4231215.0,\n", + " 0.0,\n", + " 32000000.0,\n", + " 4790000.0,\n", + " -1730939.0,\n", + " 0.0,\n", + " 0.0,\n", + " 24200000.0,\n", + " 0.0,\n", + " 22116152.0,\n", + " 31193053.0,\n", + " 37650000.0,\n", + " -9000000.0,\n", + " 22800000.0,\n", + " -147562.0,\n", + " -12000000.0,\n", + " 4900000.0,\n", + " 33600000.0,\n", + " 6800000.0,\n", + " -1573107.0,\n", + " -20000000.0,\n", + " -18769.0,\n", + " 170483.0,\n", + " -467355.0,\n", + " 8000000.0,\n", + " 999622.0,\n", + " 16000000.0,\n", + " -8000000.0,\n", + " -13000000.0,\n", + " 20700000.0,\n", + " -42500000.0,\n", + " -15000000.0,\n", + " -14666342.0,\n", + " -5500000.0,\n", + " -32100000.0,\n", + " -13749680.0,\n", + " -18704226.0,\n", + " -36624819.0,\n", + " -1099560838.0,\n", + " -15278000.0,\n", + " -18586498.0,\n", + " -52781920.0,\n", + " -30348023.0,\n", + " -49300000.0,\n", + " -37948000.0,\n", + " -87000000.0,\n", + " -47114435.0,\n", + " -2397701809.0,\n", + " -698312689.0,\n", + " -989962610.0,\n", + " -96941620.0,\n", + " -399545745.0,\n", + " -102725701.0,\n", + " -60519261.0,\n", + " -2127109510.0,\n", + " -4199788333.0,\n", + " -12213298588.0,\n", + " -109916481.0,\n", + " -553005191.0,\n", + " -149800772.0,\n", + " -598397534.0,\n", + " -128620685.0,\n", + " -190641321.0,\n", + " -136702695.0,\n", + " -77823100.0,\n", + " -128624673.0,\n", + " -113021005.0\n", + " ],\n", + " [\n", + " 'budget',\n", + " 385907.0,\n", + " 100000.0,\n", + " 245000.0,\n", + " 6000000.0,\n", + " 379000.0,\n", + " 3950000.0,\n", + " 800000.0,\n", + " 200000.0,\n", + " 325000.0,\n", + " 609000.0,\n", + " 1200000.0,\n", + " 2000000.0,\n", + " 1644736.0,\n", + " 1500000.0,\n", + " 1288000.0,\n", + " 1250000.0,\n", + " 950000.0,\n", + " 2627000.0,\n", + " 2361000.0,\n", + " 1250000.0,\n", + " 2100000.0,\n", + " 2000000.0,\n", + " 3000000.0,\n", + " 1000000.0,\n", + " 3768785.0,\n", + " 1800000.0,\n", + " 750000.0,\n", + " 210000.0,\n", + " 910000.0,\n", + " 1200000.0,\n", + " 1000000.0,\n", + " 350000.0,\n", + " 3000000.0,\n", + " 2883848.0,\n", + " 806947.0,\n", + " 2000000.0,\n", + " 62000.0,\n", + " 1000000.0,\n", + " 120000.0,\n", + " 150000.0,\n", + " 1200000.0,\n", + " 3000000.0,\n", + " 114000.0,\n", + " 100000.0,\n", + " 600000.0,\n", + " 27000.0,\n", + " 10000.0,\n", + " 500000.0,\n", + " 83532.0,\n", + " 229575.0,\n", + " 960000.0,\n", + " 20000.0,\n", + " 300000.0,\n", + " 100000.0,\n", + " 1000000.0,\n", + " 250000.0,\n", + " 1250000.0,\n", + " 550000.0,\n", + " 475000.0,\n", + " 650000.0,\n", + " 175000.0,\n", + " 100000.0,\n", + " 1100000.0,\n", + " 160000.0,\n", + " 34000.0,\n", + " 23000.0,\n", + " 7000.0,\n", + " 800000.0,\n", + " 230000.0,\n", + " 25000.0,\n", + " 200000.0,\n", + " 25000.0,\n", + " 60000.0,\n", + " 40000.0,\n", + " 10000.0,\n", + " 40000.0,\n", + " 24000.0,\n", + " 218.0,\n", + " 1100.0,\n", + " 3250.0,\n", + " 100000.0,\n", + " 10000.0,\n", + " 200000.0,\n", + " 15000.0,\n", + " 65000.0,\n", + " 9000.0,\n", + " 50000.0,\n", + " 1400.0,\n", + " 15000.0,\n", + " 25000.0,\n", + " 150000.0\n", " ],\n", " [\n", " 'x',\n", @@ -369,14 +1523,26 @@ " }\n", " },\n", " 'axis': {\n", - " 'x': {},\n", - " 'y': {},\n", - " 'y2': {}\n", + " 'x': {\n", + " 'tick': {\n", + " 'count': 10\n", + " }\n", + " },\n", + " 'y': {\n", + " 'tick': {\n", + " 'format': ''\n", + " }\n", + " },\n", + " 'y2': {\n", + " 'tick': {}\n", + " }\n", " },\n", " 'zoom': {\n", " 'enabled': true\n", " }\n", "};\n", + " data['axis']['y']['tick']['format'] = d3.format('')\n", + " data['axis']['y2']['tick']['format'] = d3.format('')\n", " data['bindto']='#chart'\n", " c3.generate(data);\n", " \n", @@ -386,31 +1552,61 @@ "" ] }, - "execution_count": 46, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "plot_data = data.movie.groupby(['title_year']).mean()[['gross']].fillna(0)\n", + "plot_data = data.movie.groupby(['title_year']).min()[['gross', 'net', 'budget']].fillna(0)\n", "c3.plot(plot_data, zoom=True)" ] }, { "cell_type": "code", - "execution_count": 25, - "metadata": {}, + "execution_count": 10, + "metadata": { + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } + }, "outputs": [], "source": [ - "country_group = data.movie.groupby('country').count()['duration']\n", - "counts = country_group.values.tolist()\n", + "country_group = data.movie.groupby('country').mean()['imdb_score']\n", + "values = country_group.values.tolist()\n", "countries = country_group.index.values.tolist()" ] }, { "cell_type": "code", - "execution_count": 47, - "metadata": {}, + "execution_count": 11, + "metadata": { + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } + }, "outputs": [], "source": [ "from iplotter import PlotlyPlotter\n", @@ -424,9 +1620,9 @@ " \"type\": 'choropleth',\n", " \"locationmode\": 'country names',\n", " \"locations\": countries,\n", - " \"z\": counts,\n", + " \"z\": values,\n", " \"zmin\": 0,\n", - " \"zmax\": max(counts),\n", + " \"zmax\": max(values),\n", " \"colorscale\": [\n", " [0, 'rgb(242,240,247)'], [0.2, 'rgb(218,218,235)'],\n", " [0.4, 'rgb(188,189,220)'], [0.6, 'rgb(158,154,200)'],\n", @@ -459,8 +1655,25 @@ { "cell_type": "markdown", "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 5, + "height": 4, + "hidden": false, + "row": 25, + "width": 4 + }, + "report_default": { + "hidden": false + } + } + } + }, "variables": { - " country_plot ": "" + " country_plot ": "" } }, "source": [ @@ -469,17 +1682,10456 @@ "{{ country_plot }}" ] }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 5, + "height": 37, + "hidden": false, + "row": 29, + "width": 4 + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "budget\n", + " 237000000.0 7.9\n", + " 300000000.0 7.1\n", + " 245000000.0 6.8\n", + " 250000000.0 8.5\n", + "NaN 7.1\n", + " 263700000.0 6.6\n", + " 258000000.0 6.2\n", + " 260000000.0 7.8\n", + " 250000000.0 7.5\n", + " 250000000.0 7.5\n", + " 250000000.0 6.9\n", + " 209000000.0 6.1\n", + " 200000000.0 6.7\n", + " 225000000.0 7.3\n", + " 215000000.0 6.5\n", + " 225000000.0 7.2\n", + " 225000000.0 6.6\n", + " 220000000.0 8.1\n", + " 250000000.0 6.7\n", + " 225000000.0 6.8\n", + " 250000000.0 7.5\n", + " 230000000.0 7.0\n", + " 200000000.0 6.7\n", + " 225000000.0 7.9\n", + " 180000000.0 6.1\n", + " 207000000.0 7.2\n", + " 200000000.0 7.7\n", + " 250000000.0 8.2\n", + " 209000000.0 5.9\n", + " 150000000.0 7.0\n", + " ... \n", + " 24000.0 7.0\n", + "NaN 6.3\n", + " 23000.0 7.1\n", + " 25000.0 4.8\n", + " 22000.0 3.3\n", + " 20000.0 6.9\n", + "NaN 4.6\n", + " 17350.0 3.0\n", + " 15000.0 6.6\n", + " 15000.0 7.4\n", + " 15000.0 6.2\n", + " 20000.0 4.0\n", + " 10000.0 6.1\n", + " 4500.0 6.9\n", + " 10000.0 7.5\n", + " 10000.0 6.7\n", + " 1000000.0 7.4\n", + "NaN 6.1\n", + " 200000.0 5.4\n", + "NaN 6.4\n", + " 7000.0 7.0\n", + " 7000.0 6.3\n", + " 7000.0 6.9\n", + " 3250.0 7.8\n", + " 9000.0 6.4\n", + "NaN 7.7\n", + "NaN 7.5\n", + " 1400.0 6.3\n", + "NaN 6.3\n", + " 1100.0 6.6\n", + "Name: imdb_score, Length: 5043, dtype: float64" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data.movie.set_index(['budget'])['imdb_score']" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "col": 0, + "height": 15, + "hidden": false, + "row": 123, + "width": 9 + }, + "report_default": { + "hidden": false + } + } + } + } + }, + "outputs": [ + { + "data": { + "text/html": [ + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "score_by_budget = data.movie.set_index(['director_facebook_likes'])[['net']]\n", + "c3.plot(score_by_budget, kind='scatter', zoom=True, )" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "outputs": [], + "source": [ + "from ipywidgets import interact, interactive, fixed, interact_manual" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "outputs": [], + "source": [ + "def f(country):\n", + " df = data.movie[data.movie['country'] == country]\n", + " ax = df.groupby(['director_name']).agg({'director_facebook_likes':'sum', 'gross':'sum'}).plot(kind='scatter', x='director_facebook_likes', y='gross')\n", + " plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c1b49296252e482a888cbcd1bd7c1f60" + } + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "interact(f, country=data.movie.country.drop_duplicates().dropna().values.tolist());" + ] + }, { "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true + "collapsed": true, + "extensions": { + "jupyter_dashboards": { + "version": 1, + "views": { + "grid_default": { + "hidden": true + }, + "report_default": { + "hidden": true + } + } + } + } }, "outputs": [], "source": [] } ], "metadata": { + "extensions": { + "jupyter_dashboards": { + "activeView": "report_default", + "version": 1, + "views": { + "grid_default": { + "cellMargin": 10, + "defaultCellHeight": 20, + "maxColumns": 12, + "name": "grid", + "type": "grid" + }, + "report_default": { + "name": "report", + "type": "report" + } + } + } + }, "kernelspec": { "display_name": "Python [default]", "language": "python", diff --git a/src/pyDataVizDay.py b/src/pyDataVizDay.py new file mode 100644 index 0000000..98c3e25 --- /dev/null +++ b/src/pyDataVizDay.py @@ -0,0 +1,39 @@ +""" +PyDataVizDay + +A python implementation of the Data Viz Day visualization built from the Kaggle +IMDB 5000 Movie Dataset. + +""" + +from flask import Flask +from flask import request, render_template, make_response, jsonify + + +app = Flask(__name__) + +@app.route('/') +def index(): + return render_template('index.html', body='Hello') + +@app.route('/investor') +def investor(): + return render_template('investor.html', body='Hello Investor') + +@app.route('/enthusiast') +def enthusiast(): + return render_template('enthusiast.html', body='Hello Enthusiast') + + + + +if __name__ == '__main__': + import argparse + parser = argparse.ArgumentParser(description='pyDataVizDay') + parser.add_argument('--port', default='5000') + parser.add_argument('--debug', dest='debug', action='store_true') + parser.add_argument('--no_debug', dest='debug', action='store_false') + parser.set_defaults(debug=False) + args = parser.parse_args() + # webbrowser.open('http://' + str(host) + ':' + str(port) + '/') + app.run(debug=args.debug, host='0.0.0.0', port=int(args.port)) \ No newline at end of file diff --git a/src/templates/enthusiast.html b/src/templates/enthusiast.html new file mode 100644 index 0000000..2f504ed --- /dev/null +++ b/src/templates/enthusiast.html @@ -0,0 +1,2 @@ +{% extends "layout.html" %} +{% set active_page = "enthusiast" %} \ No newline at end of file diff --git a/src/templates/index.html b/src/templates/index.html new file mode 100644 index 0000000..9f87539 --- /dev/null +++ b/src/templates/index.html @@ -0,0 +1,2 @@ +{% extends "layout.html" %} +{% set active_page = "index" %} \ No newline at end of file diff --git a/src/templates/investor.html b/src/templates/investor.html new file mode 100644 index 0000000..f933441 --- /dev/null +++ b/src/templates/investor.html @@ -0,0 +1,2 @@ +{% extends "layout.html" %} +{% set active_page = "investor" %} \ No newline at end of file diff --git a/src/templates/layout.html b/src/templates/layout.html new file mode 100644 index 0000000..588008b --- /dev/null +++ b/src/templates/layout.html @@ -0,0 +1,40 @@ + + + + {{ title }} + + + + + + + + + {% set navigation_bar = [ + ('/investor', 'investor', 'Investor'), + ('/enthusiast', 'enthusiast', 'Enthusiast'), + ] -%} + {% set active_page = active_page|default('index') -%} + + + +{{ body }} + + + diff --git a/src/templates/pyDataVizDay.py b/src/templates/pyDataVizDay.py new file mode 100644 index 0000000..d345e29 --- /dev/null +++ b/src/templates/pyDataVizDay.py @@ -0,0 +1,32 @@ +""" +PyDataVizDay + +A python implementation of the Data Viz Day visualization built from the Kaggle +IMDB 5000 Movie Dataset. + +""" + +from flask import Flask +from flask import request, render_template, make_response, jsonify + + +app = Flask(__name__): + +@app.route('/') +def index(): + return render_template('index.html', body='Hello') + + + + +if __name__ == '__main__': + import argparse + parser = argparse.ArgumentParser(description='pyDataVizDay') + parser.add_argument('--port', default='5000') + parser.add_argument('--debug', dest='debug', action='store_true') + parser.add_argument('--no_debug', dest='debug', action='store_false') + parser.set_defaults(debug=False) + args = parser.parse_args() + host = socket.gethostbyname(socket.gethostname()) + # webbrowser.open('http://' + str(host) + ':' + str(port) + '/') + app.run(debug=args.debug, host=str(host), port=int(args.port)) \ No newline at end of file