{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Jupyter Notebook es un modo muy fácil de empezar con [data science](https://en.wikipedia.org/wiki/Data_science) y programar en Python, te permite correr código en diferentes órdenes y combinarlo con texto, gráficas e incluso algunos elementos web que pueden ser muy prácticos para presentar datos. De ahí que sea *notebook.*\n", "\n", "### Instalando Jupyter Notebook\n", "\n", "No me voy a concentrar en cómo instalar Jupyter. Puedes instalarlo pendiante pip si ya tienes instalado Python o puedes utilizar Anaconda. Si necesitas instalar Python y estas en macOS puedes instalarlo utilizando [brew](). Recuerda instalar Python 3\n", "\n", "Pandas y Jupyter estan incluidos con [Anaconda](https://www.anaconda.com/). Anaconda es un paquete de varias herramietas de data science por lo cual para la mayoría de los usuarios va a ser la forma más fácil de instalar todo.\n", "\n", "- [Instalación de Python](https://www.python.org/downloads/release/python-373/)\n", "- [Instalando Brew (Opcional si utilizas macOS)]()\n", "- [Instalación de Jupyter (Si utilizas Anaconda no necesitas instalar Python aparte)](https://jupyter.org/install)\n", "\n", "### ¿Qué podemos hacer con Jupyter y Pandas?\n", "\n", "#### Hacer este artículo!\n", "\n", "Si! Además de aquí en el blog, este artículo lo cree utilizando Jupyter Notebook. Puedes ver una versión de ella en [NBviwer](https://nbviewer.jupyter.org/github/Darkade/notebooks/blob/master/Cosas%20que%20hacer%20con%20jupyter.ipynb) o [GitHub](https://github.com/Darkade/notebooks/blob/master/Cosas%20que%20hacer%20con%20jupyter.ipynb) (más sobre esas dos cosas adelante).\n", "\n", "~~El resto del artículo esta escrito como si estuvieras leyendo esto en una libreta de Jupyter~~" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Ser el backbone de Five Thirty Eight\n", "\n", "[Five Thirty Eight](https://fivethirtyeight.com/) es **el sitio** de periodismo de datos, para algunos de los ejemplos este artículo tomé datos de su [Github](https://github.com/fivethirtyeight/data) que utilizaron [aquí](https://fivethirtyeight.com/features/americas-favorite-star-wars-movies-and-least-favorite-characters/).\n", "\n", "#### Importar Datos\n", "\n", "Para empezar pandas puede adquirir datos de básicamente cualquier lado. Se pueden introducir datos a mano, importar CSVs, leer datos estilo excel que hayas copiado, JSONs, HTMLs, hacer queries de SQL, o conectarse a Google BigQuery y más.\n", "\n", "\n", "Vamos a empezar importando un CSV sencillo e imprimiendolo cómo tabla." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from IPython.display import display, GeoJSON" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "scrolled": 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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RespondentIDHave you seen any of the 6 films in the Star Wars franchise?Do you consider yourself to be a fan of the Star Wars film franchise?Which of the following Star Wars films have you seen? Please select all that apply.Unnamed: 4Unnamed: 5Unnamed: 6Unnamed: 7Unnamed: 8Please rank the Star Wars films in order of preference with 1 being your favorite film in the franchise and 6 being your least favorite film....Unnamed: 28Which character shot first?Are you familiar with the Expanded Universe?Do you consider yourself to be a fan of the Expanded Universe?��Do you consider yourself to be a fan of the Star Trek franchise?GenderAgeHousehold IncomeEducationLocation (Census Region)
0NaNResponseResponseStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the JediStar Wars: Episode I The Phantom Menace...YodaResponseResponseResponseResponseResponseResponseResponseResponseResponse
13.292880e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi3...Very favorablyI don't understand this questionYesNoNoMale18-29NaNHigh school degreeSouth Atlantic
23.292880e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNYesMale18-29$0 - $24,999Bachelor degreeWest South Central
33.292765e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithNaNNaNNaN1...Unfamiliar (N/A)I don't understand this questionNoNaNNoMale18-29$0 - $24,999High school degreeWest North Central
43.292763e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi5...Very favorablyI don't understand this questionNoNaNYesMale18-29$100,000 - $149,999Some college or Associate degreeWest North Central
53.292731e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi5...Somewhat favorablyGreedoYesNoNoMale18-29$100,000 - $149,999Some college or Associate degreeWest North Central
63.292719e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi1...Very favorablyHanYesNoYesMale18-29$25,000 - $49,999Bachelor degreeMiddle Atlantic
73.292685e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyHanYesNoNoMale18-29NaNHigh school degreeEast North Central
83.292664e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Very favorablyHanNoNaNYesMale18-29NaNHigh school degreeSouth Atlantic
93.292654e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi5...Somewhat favorablyHanNoNaNNoMale18-29$0 - $24,999Some college or Associate degreeSouth Atlantic
103.292640e+09YesNoNaNStar Wars: Episode II Attack of the ClonesNaNNaNNaNNaN1...Very favorablyI don't understand this questionNoNaNNoMale18-29$25,000 - $49,999Some college or Associate degreePacific
113.292638e+09YesNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
123.292635e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
133.292609e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi3...Very favorablyGreedoNoNaNNoMale18-29$25,000 - $49,999Bachelor degreeSouth Atlantic
143.292597e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Very favorablyI don't understand this questionNoNaNNoMale30-44$50,000 - $99,999Graduate degreeMountain
153.292587e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Very favorablyHanNoNaNNoMale18-29NaNHigh school degreeEast North Central
163.292583e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Somewhat favorablyHanYesYesYesMale18-29$0 - $24,999Some college or Associate degreeWest South Central
173.292581e+09YesYesNaNNaNNaNStar Wars: Episode IV A New HopeNaNNaN4...Very unfavorablyHanYesYesNoMale18-29$50,000 - $99,999Bachelor degreeNew England
183.292573e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithNaNNaNStar Wars: Episode VI Return of the Jedi1...Very favorablyGreedoNoNaNNoMale18-29NaNSome college or Associate degreeMiddle Atlantic
193.292565e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyHanNoNaNNoMale18-29NaNHigh school degreeSouth Atlantic
203.292562e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyGreedoNoNaNYesMale18-29$50,000 - $99,999Some college or Associate degreeWest North Central
213.292522e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyHanNoNaNNoMale18-29NaNSome college or Associate degreePacific
223.292521e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackNaN3...Neither favorably nor unfavorably (neutral)I don't understand this questionNoNaNNoMale18-29NaNBachelor degreePacific
233.292512e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyGreedoYesYesYesMale18-29$50,000 - $99,999Bachelor degreeSouth Atlantic
243.292483e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyHanNoNaNNoMale18-29$0 - $24,999Bachelor degreePacific
253.292465e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi1...Very favorablyHanNoNaNNoMale18-29NaNNaNEast North Central
263.292448e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNYesMale18-29$0 - $24,999High school degreeEast South Central
273.292420e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Very favorablyGreedoYesNoNoMale18-29$100,000 - $149,999Some college or Associate degreeSouth Atlantic
283.292384e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyGreedoNoNaNNoMale18-29NaNSome college or Associate degreeMiddle Atlantic
293.292380e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyHanYesNoNoMale18-29NaNSome college or Associate degreeMiddle Atlantic
..................................................................
11573.288426e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi3...Very favorablyI don't understand this questionNoNaNNoFemale30-44$50,000 - $99,999Graduate degreeMiddle Atlantic
11583.288423e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNoMale45-60$100,000 - $149,999Graduate degreeMiddle Atlantic
11593.288423e+09YesNoNaNNaNNaNNaNStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi2...Very favorablyI don't understand this questionNoNaNNoFemale45-60$0 - $24,999Bachelor degreePacific
11603.288422e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNoFemale> 60$0 - $24,999Some college or Associate degreeWest South Central
11613.288421e+09YesNoStar Wars: Episode I The Phantom MenaceNaNStar Wars: Episode III Revenge of the SithNaNNaNStar Wars: Episode VI Return of the Jedi3...Very favorablyI don't understand this questionNoNaNNoFemale18-29$25,000 - $49,999Some college or Associate degreePacific
11623.288418e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithNaNStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi3...Neither favorably nor unfavorably (neutral)GreedoNoNaNNoNaNNaNNaNNaNNaN
11633.288418e+09YesYesStar Wars: Episode I The Phantom MenaceNaNNaNStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Very favorablyI don't understand this questionNoNaNNoFemale18-29$25,000 - $49,999Graduate degreeSouth Atlantic
11643.288417e+09YesNoNaNNaNNaNStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi5...Very favorablyHanYesNoNoFemale> 60NaNBachelor degreeNew England
11653.288415e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithNaNStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi5...Neither favorably nor unfavorably (neutral)HanNoNaNNoMale45-60$100,000 - $149,999Graduate degreeMiddle Atlantic
11663.288414e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi5...Very favorablyGreedoNoNaNYesFemale30-44$50,000 - $99,999Bachelor degreeMountain
11673.288413e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very favorablyI don't understand this questionNoNaNNoFemale18-29$150,000+Some college or Associate degreeSouth Atlantic
11683.288410e+09YesNoStar Wars: Episode I The Phantom MenaceNaNNaNNaNStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi3...Very favorablyGreedoYesNoNoFemale30-44NaNGraduate degreeEast North Central
11693.288410e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNoFemale30-44$150,000+Graduate degreeEast North Central
11703.288409e+09YesYesStar Wars: Episode I The Phantom MenaceNaNNaNStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Very favorablyHanNoNaNYesMale45-60$25,000 - $49,999Bachelor degreeSouth Atlantic
11713.288403e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNoFemale45-60NaNGraduate degreeEast North Central
11723.288403e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Somewhat unfavorablyHanYesYesYesFemale> 60$25,000 - $49,999Bachelor degreeMountain
11733.288403e+09YesYesNaNNaNNaNStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi2...Somewhat favorablyGreedoYesNoYesFemale> 60NaNHigh school degreePacific
11743.288403e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi5...Very favorablyHanNoNaNYesFemale30-44NaNBachelor degreeMiddle Atlantic
11753.288402e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithNaNNaNNaN1...Very favorablyI don't understand this questionNoNaNYesFemale> 60NaNSome college or Associate degreeWest North Central
11763.288401e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi1...Somewhat favorablyHanYesNoYesFemale45-60$50,000 - $99,999Graduate degreeWest South Central
11773.288398e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesNaNNaNNaNNaN2...Neither favorably nor unfavorably (neutral)I don't understand this questionNoNaNNoFemale45-60$0 - $24,999High school degreeMiddle Atlantic
11783.288396e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithNaNStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi1...Very favorablyI don't understand this questionNoNaNYesMale> 60$50,000 - $99,999Some college or Associate degreePacific
11793.288395e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNoFemale18-29NaNLess than high school degreeWest North Central
11803.288392e+09YesYesNaNNaNNaNNaNStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi3...Very favorablyHanNoNaNYesFemale45-60$0 - $24,999Some college or Associate degreeWest North Central
11813.288390e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi3...Very favorablyHanNoNaNNoFemale45-60$0 - $24,999Some college or Associate degreePacific
11823.288389e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi5...Very favorablyHanNoNaNYesFemale18-29$0 - $24,999Some college or Associate degreeEast North Central
11833.288379e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Very favorablyI don't understand this questionNoNaNYesFemale30-44$50,000 - $99,999Bachelor degreeMountain
11843.288375e+09NoNaNNaNNaNNaNNaNNaNNaNNaN...NaNNaNNaNNaNNoFemale30-44$50,000 - $99,999Bachelor degreeMiddle Atlantic
11853.288373e+09YesYesStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesStar Wars: Episode III Revenge of the SithStar Wars: Episode IV A New HopeStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi4...Very favorablyHanNoNaNYesFemale45-60$100,000 - $149,999Some college or Associate degreeEast North Central
11863.288373e+09YesNoStar Wars: Episode I The Phantom MenaceStar Wars: Episode II Attack of the ClonesNaNNaNStar Wars: Episode V The Empire Strikes BackStar Wars: Episode VI Return of the Jedi6...Very unfavorablyI don't understand this questionNoNaNNoFemale> 60$50,000 - $99,999Graduate degreePacific
\n", "

1187 rows × 38 columns

\n", "
" ], "text/plain": [ " RespondentID \\\n", "0 NaN \n", "1 3.292880e+09 \n", "2 3.292880e+09 \n", "3 3.292765e+09 \n", "4 3.292763e+09 \n", "5 3.292731e+09 \n", "6 3.292719e+09 \n", "7 3.292685e+09 \n", "8 3.292664e+09 \n", "9 3.292654e+09 \n", "10 3.292640e+09 \n", "11 3.292638e+09 \n", "12 3.292635e+09 \n", "13 3.292609e+09 \n", "14 3.292597e+09 \n", "15 3.292587e+09 \n", "16 3.292583e+09 \n", "17 3.292581e+09 \n", "18 3.292573e+09 \n", "19 3.292565e+09 \n", "20 3.292562e+09 \n", "21 3.292522e+09 \n", "22 3.292521e+09 \n", "23 3.292512e+09 \n", "24 3.292483e+09 \n", "25 3.292465e+09 \n", "26 3.292448e+09 \n", "27 3.292420e+09 \n", "28 3.292384e+09 \n", "29 3.292380e+09 \n", "... ... \n", "1157 3.288426e+09 \n", "1158 3.288423e+09 \n", "1159 3.288423e+09 \n", "1160 3.288422e+09 \n", "1161 3.288421e+09 \n", "1162 3.288418e+09 \n", "1163 3.288418e+09 \n", "1164 3.288417e+09 \n", "1165 3.288415e+09 \n", "1166 3.288414e+09 \n", "1167 3.288413e+09 \n", "1168 3.288410e+09 \n", "1169 3.288410e+09 \n", "1170 3.288409e+09 \n", "1171 3.288403e+09 \n", "1172 3.288403e+09 \n", "1173 3.288403e+09 \n", "1174 3.288403e+09 \n", "1175 3.288402e+09 \n", "1176 3.288401e+09 \n", "1177 3.288398e+09 \n", "1178 3.288396e+09 \n", "1179 3.288395e+09 \n", "1180 3.288392e+09 \n", "1181 3.288390e+09 \n", "1182 3.288389e+09 \n", "1183 3.288379e+09 \n", "1184 3.288375e+09 \n", "1185 3.288373e+09 \n", "1186 3.288373e+09 \n", "\n", " Have you seen any of the 6 films in the Star Wars franchise? \\\n", "0 Response \n", "1 Yes \n", "2 No \n", "3 Yes \n", "4 Yes \n", "5 Yes \n", "6 Yes \n", "7 Yes \n", "8 Yes \n", "9 Yes \n", "10 Yes \n", "11 Yes \n", "12 No \n", "13 Yes \n", "14 Yes \n", "15 Yes \n", "16 Yes \n", "17 Yes \n", "18 Yes \n", "19 Yes \n", "20 Yes \n", "21 Yes \n", "22 Yes \n", "23 Yes \n", "24 Yes \n", "25 Yes \n", "26 No \n", "27 Yes \n", "28 Yes \n", "29 Yes \n", "... ... \n", "1157 Yes \n", "1158 No \n", "1159 Yes \n", "1160 No \n", "1161 Yes \n", "1162 Yes \n", "1163 Yes \n", "1164 Yes \n", "1165 Yes \n", "1166 Yes \n", "1167 Yes \n", "1168 Yes \n", "1169 No \n", "1170 Yes \n", "1171 No \n", "1172 Yes \n", "1173 Yes \n", "1174 Yes \n", "1175 Yes \n", "1176 Yes \n", "1177 Yes \n", "1178 Yes \n", "1179 No \n", "1180 Yes \n", "1181 Yes \n", "1182 Yes \n", "1183 Yes \n", "1184 No \n", "1185 Yes \n", "1186 Yes \n", "\n", " Do you consider yourself to be a fan of the Star Wars film franchise? \\\n", "0 Response \n", "1 Yes \n", "2 NaN \n", "3 No \n", "4 Yes \n", "5 Yes \n", "6 Yes \n", "7 Yes \n", "8 Yes \n", "9 Yes \n", "10 No \n", "11 NaN \n", "12 NaN \n", "13 No \n", "14 Yes \n", "15 Yes \n", "16 Yes \n", "17 Yes \n", "18 Yes \n", "19 Yes \n", "20 Yes \n", "21 Yes \n", "22 No \n", "23 Yes \n", "24 Yes \n", "25 Yes \n", "26 NaN \n", "27 Yes \n", "28 Yes \n", "29 Yes \n", "... ... \n", "1157 No \n", "1158 NaN \n", "1159 No \n", "1160 NaN \n", "1161 No \n", "1162 No \n", "1163 Yes \n", "1164 No \n", "1165 No \n", "1166 Yes \n", "1167 Yes \n", "1168 No \n", "1169 NaN \n", "1170 Yes \n", "1171 NaN \n", "1172 Yes \n", "1173 Yes \n", "1174 Yes \n", "1175 No \n", "1176 Yes \n", "1177 No \n", "1178 No \n", "1179 NaN \n", "1180 Yes \n", "1181 Yes \n", "1182 Yes \n", "1183 Yes \n", "1184 NaN \n", "1185 Yes \n", "1186 No \n", "\n", " Which of the following Star Wars films have you seen? Please select all that apply. \\\n", "0 Star Wars: Episode I The Phantom Menace \n", "1 Star Wars: Episode I The Phantom Menace \n", "2 NaN \n", "3 Star Wars: Episode I The Phantom Menace \n", "4 Star Wars: Episode I The Phantom Menace \n", "5 Star Wars: Episode I The Phantom Menace \n", "6 Star Wars: Episode I The Phantom Menace \n", "7 Star Wars: Episode I The Phantom Menace \n", "8 Star Wars: Episode I The Phantom Menace \n", "9 Star Wars: Episode I The Phantom Menace \n", "10 NaN \n", "11 NaN \n", "12 NaN \n", "13 Star Wars: Episode I The Phantom Menace \n", "14 Star Wars: Episode I The Phantom Menace \n", "15 Star Wars: Episode I The Phantom Menace \n", "16 Star Wars: Episode I The Phantom Menace \n", "17 NaN \n", "18 Star Wars: Episode I The Phantom Menace \n", "19 Star Wars: Episode I The Phantom Menace \n", "20 Star Wars: Episode I The Phantom Menace \n", "21 Star Wars: Episode I The Phantom Menace \n", "22 Star Wars: Episode I The Phantom Menace \n", "23 Star Wars: Episode I The Phantom Menace \n", "24 Star Wars: Episode I The Phantom Menace \n", "25 Star Wars: Episode I The Phantom Menace \n", "26 NaN \n", "27 Star Wars: Episode I The Phantom Menace \n", "28 Star Wars: Episode I The Phantom Menace \n", "29 Star Wars: Episode I The Phantom Menace \n", "... ... \n", "1157 Star Wars: Episode I The Phantom Menace \n", "1158 NaN \n", "1159 NaN \n", "1160 NaN \n", "1161 Star Wars: Episode I The Phantom Menace \n", "1162 Star Wars: Episode I The Phantom Menace \n", "1163 Star Wars: Episode I The Phantom Menace \n", "1164 NaN \n", "1165 Star Wars: Episode I The Phantom Menace \n", "1166 Star Wars: Episode I The Phantom Menace \n", "1167 Star Wars: Episode I The Phantom Menace \n", "1168 Star Wars: Episode I The Phantom Menace \n", "1169 NaN \n", "1170 Star Wars: Episode I The Phantom Menace \n", "1171 NaN \n", "1172 Star Wars: Episode I The Phantom Menace \n", "1173 NaN \n", "1174 Star Wars: Episode I The Phantom Menace \n", "1175 Star Wars: Episode I The Phantom Menace \n", "1176 Star Wars: Episode I The Phantom Menace \n", "1177 Star Wars: Episode I The Phantom Menace \n", "1178 Star Wars: Episode I The Phantom Menace \n", "1179 NaN \n", "1180 NaN \n", "1181 Star Wars: Episode I The Phantom Menace \n", "1182 Star Wars: Episode I The Phantom Menace \n", "1183 Star Wars: Episode I The Phantom Menace \n", "1184 NaN \n", "1185 Star Wars: Episode I The Phantom Menace \n", "1186 Star Wars: Episode I The Phantom Menace \n", "\n", " Unnamed: 4 \\\n", "0 Star Wars: Episode II Attack of the Clones \n", "1 Star Wars: Episode II Attack of the Clones \n", "2 NaN \n", "3 Star Wars: Episode II Attack of the Clones \n", "4 Star Wars: Episode II Attack of the Clones \n", "5 Star Wars: Episode II Attack of the Clones \n", "6 Star Wars: Episode II Attack of the Clones \n", "7 Star Wars: Episode II Attack of the Clones \n", "8 Star Wars: Episode II Attack of the Clones \n", "9 Star Wars: Episode II Attack of the Clones \n", "10 Star Wars: Episode II Attack of the Clones \n", "11 NaN \n", "12 NaN \n", "13 Star Wars: Episode II Attack of the Clones \n", "14 Star Wars: Episode II Attack of the Clones \n", "15 Star Wars: Episode II Attack of the Clones \n", "16 Star Wars: Episode II Attack of the Clones \n", "17 NaN \n", "18 Star Wars: Episode II Attack of the Clones \n", "19 Star Wars: Episode II Attack of the Clones \n", "20 Star Wars: Episode II Attack of the Clones \n", "21 Star Wars: Episode II Attack of the Clones \n", "22 Star Wars: Episode II Attack of the Clones \n", "23 Star Wars: Episode II Attack of the Clones \n", "24 Star Wars: Episode II Attack of the Clones \n", "25 Star Wars: Episode II Attack of the Clones \n", "26 NaN \n", "27 Star Wars: Episode II Attack of the Clones \n", "28 Star Wars: Episode II Attack of the Clones \n", "29 Star Wars: Episode II Attack of the Clones \n", "... ... \n", "1157 Star Wars: Episode II Attack of the Clones \n", "1158 NaN \n", "1159 NaN \n", "1160 NaN \n", "1161 NaN \n", "1162 Star Wars: Episode II Attack of the Clones \n", "1163 NaN \n", "1164 NaN \n", "1165 Star Wars: Episode II Attack of the Clones \n", "1166 Star Wars: Episode II Attack of the Clones \n", "1167 Star Wars: Episode II Attack of the Clones \n", "1168 NaN \n", "1169 NaN \n", "1170 NaN \n", "1171 NaN \n", "1172 Star Wars: Episode II Attack of the Clones \n", "1173 NaN \n", "1174 Star Wars: Episode II Attack of the Clones \n", "1175 Star Wars: Episode II Attack of the Clones \n", "1176 Star Wars: Episode II Attack of the Clones \n", "1177 Star Wars: Episode II Attack of the Clones \n", "1178 Star Wars: Episode II Attack of the Clones \n", "1179 NaN \n", "1180 NaN \n", "1181 Star Wars: Episode II Attack of the Clones \n", "1182 Star Wars: Episode II Attack of the Clones \n", "1183 Star Wars: Episode II Attack of the Clones \n", "1184 NaN \n", "1185 Star Wars: Episode II Attack of the Clones \n", "1186 Star Wars: Episode II Attack of the Clones \n", "\n", " Unnamed: 5 \\\n", "0 Star Wars: Episode III Revenge of the Sith \n", "1 Star Wars: Episode III Revenge of the Sith \n", "2 NaN \n", "3 Star Wars: Episode III Revenge of the Sith \n", "4 Star Wars: Episode III Revenge of the Sith \n", "5 Star Wars: Episode III Revenge of the Sith \n", "6 Star Wars: Episode III Revenge of the Sith \n", "7 Star Wars: Episode III Revenge of the Sith \n", "8 Star Wars: Episode III Revenge of the Sith \n", "9 Star Wars: Episode III Revenge of the Sith \n", "10 NaN \n", "11 NaN \n", "12 NaN \n", "13 Star Wars: Episode III Revenge of the Sith \n", "14 Star Wars: Episode III Revenge of the Sith \n", "15 Star Wars: Episode III Revenge of the Sith \n", "16 Star Wars: Episode III Revenge of the Sith \n", "17 NaN \n", "18 Star Wars: Episode III Revenge of the Sith \n", "19 Star Wars: Episode III Revenge of the Sith \n", "20 Star Wars: Episode III Revenge of the Sith \n", "21 Star Wars: Episode III Revenge of the Sith \n", "22 Star Wars: Episode III Revenge of the Sith \n", "23 Star Wars: Episode III Revenge of the Sith \n", "24 Star Wars: Episode III Revenge of the Sith \n", "25 Star Wars: Episode III Revenge of the Sith \n", "26 NaN \n", "27 Star Wars: Episode III Revenge of the Sith \n", "28 Star Wars: Episode III Revenge of the Sith \n", "29 Star Wars: Episode III Revenge of the Sith \n", "... ... \n", "1157 Star Wars: Episode III Revenge of the Sith \n", "1158 NaN \n", "1159 NaN \n", "1160 NaN \n", "1161 Star Wars: Episode III Revenge of the Sith \n", "1162 Star Wars: Episode III Revenge of the Sith \n", "1163 NaN \n", "1164 NaN \n", "1165 Star Wars: Episode III Revenge of the Sith \n", "1166 Star Wars: Episode III Revenge of the Sith \n", "1167 Star Wars: Episode III Revenge of the Sith \n", "1168 NaN \n", "1169 NaN \n", "1170 NaN \n", "1171 NaN \n", "1172 Star Wars: Episode III Revenge of the Sith \n", "1173 NaN \n", "1174 Star Wars: Episode III Revenge of the Sith \n", "1175 Star Wars: Episode III Revenge of the Sith \n", "1176 Star Wars: Episode III Revenge of the Sith \n", "1177 NaN \n", "1178 Star Wars: Episode III Revenge of the Sith \n", "1179 NaN \n", "1180 NaN \n", "1181 Star Wars: Episode III Revenge of the Sith \n", "1182 Star Wars: Episode III Revenge of the Sith \n", "1183 Star Wars: Episode III Revenge of the Sith \n", "1184 NaN \n", "1185 Star Wars: Episode III Revenge of the Sith \n", "1186 NaN \n", "\n", " Unnamed: 6 \\\n", "0 Star Wars: Episode IV A New Hope \n", "1 Star Wars: Episode IV A New Hope \n", "2 NaN \n", "3 NaN \n", "4 Star Wars: Episode IV A New Hope \n", "5 Star Wars: Episode IV A New Hope \n", "6 Star Wars: Episode IV A New Hope \n", "7 Star Wars: Episode IV A New Hope \n", "8 Star Wars: Episode IV A New Hope \n", "9 Star Wars: Episode IV A New Hope \n", "10 NaN \n", "11 NaN \n", "12 NaN \n", "13 Star Wars: Episode IV A New Hope \n", "14 Star Wars: Episode IV A New Hope \n", "15 Star Wars: Episode IV A New Hope \n", "16 Star Wars: Episode IV A New Hope \n", "17 Star Wars: Episode IV A New Hope \n", "18 NaN \n", "19 Star Wars: Episode IV A New Hope \n", "20 Star Wars: Episode IV A New Hope \n", "21 Star Wars: Episode IV A New Hope \n", "22 Star Wars: Episode IV A New Hope \n", "23 Star Wars: Episode IV A New Hope \n", "24 Star Wars: Episode IV A New Hope \n", "25 Star Wars: Episode IV A New Hope \n", "26 NaN \n", "27 Star Wars: Episode IV A New Hope \n", "28 Star Wars: Episode IV A New Hope \n", "29 Star Wars: Episode IV A New Hope \n", "... ... \n", "1157 Star Wars: Episode IV A New Hope \n", "1158 NaN \n", "1159 NaN \n", "1160 NaN \n", "1161 NaN \n", "1162 NaN \n", "1163 Star Wars: Episode IV A New Hope \n", "1164 Star Wars: Episode IV A New Hope \n", "1165 NaN \n", "1166 Star Wars: Episode IV A New Hope \n", "1167 Star Wars: Episode IV A New Hope \n", "1168 NaN \n", "1169 NaN \n", "1170 Star Wars: Episode IV A New Hope \n", "1171 NaN \n", "1172 Star Wars: Episode IV A New Hope \n", "1173 Star Wars: Episode IV A New Hope \n", "1174 Star Wars: Episode IV A New Hope \n", "1175 NaN \n", "1176 Star Wars: Episode IV A New Hope \n", "1177 NaN \n", "1178 NaN \n", "1179 NaN \n", "1180 NaN \n", "1181 Star Wars: Episode IV A New Hope \n", "1182 Star Wars: Episode IV A New Hope \n", "1183 Star Wars: Episode IV A New Hope \n", "1184 NaN \n", "1185 Star Wars: Episode IV A New Hope \n", "1186 NaN \n", "\n", " Unnamed: 7 \\\n", "0 Star Wars: Episode V The Empire Strikes Back \n", "1 Star Wars: Episode V The Empire Strikes Back \n", "2 NaN \n", "3 NaN \n", "4 Star Wars: Episode V The Empire Strikes Back \n", "5 Star Wars: Episode V The Empire Strikes Back \n", "6 Star Wars: Episode V The Empire Strikes Back \n", "7 Star Wars: Episode V The Empire Strikes Back \n", "8 Star Wars: Episode V The Empire Strikes Back \n", "9 Star Wars: Episode V The Empire Strikes Back \n", "10 NaN \n", "11 NaN \n", "12 NaN \n", "13 Star Wars: Episode V The Empire Strikes Back \n", "14 Star Wars: Episode V The Empire Strikes Back \n", "15 Star Wars: Episode V The Empire Strikes Back \n", "16 Star Wars: Episode V The Empire Strikes Back \n", "17 NaN \n", "18 NaN \n", "19 Star Wars: Episode V The Empire Strikes Back \n", "20 Star Wars: Episode V The Empire Strikes Back \n", "21 Star Wars: Episode V The Empire Strikes Back \n", "22 Star Wars: Episode V The Empire Strikes Back \n", "23 Star Wars: Episode V The Empire Strikes Back \n", "24 Star Wars: Episode V The Empire Strikes Back \n", "25 Star Wars: Episode V The Empire Strikes Back \n", "26 NaN \n", "27 Star Wars: Episode V The Empire Strikes Back \n", "28 Star Wars: Episode V The Empire Strikes Back \n", "29 Star Wars: Episode V The Empire Strikes Back \n", "... ... \n", "1157 Star Wars: Episode V The Empire Strikes Back \n", "1158 NaN \n", "1159 Star Wars: Episode V The Empire Strikes Back \n", "1160 NaN \n", "1161 NaN \n", "1162 Star Wars: Episode V The Empire Strikes Back \n", "1163 Star Wars: Episode V The Empire Strikes Back \n", "1164 Star Wars: Episode V The Empire Strikes Back \n", "1165 Star Wars: Episode V The Empire Strikes Back \n", "1166 Star Wars: Episode V The Empire Strikes Back \n", "1167 Star Wars: Episode V The Empire Strikes Back \n", "1168 Star Wars: Episode V The Empire Strikes Back \n", "1169 NaN \n", "1170 Star Wars: Episode V The Empire Strikes Back \n", "1171 NaN \n", "1172 Star Wars: Episode V The Empire Strikes Back \n", "1173 Star Wars: Episode V The Empire Strikes Back \n", "1174 Star Wars: Episode V The Empire Strikes Back \n", "1175 NaN \n", "1176 Star Wars: Episode V The Empire Strikes Back \n", "1177 NaN \n", "1178 Star Wars: Episode V The Empire Strikes Back \n", "1179 NaN \n", "1180 Star Wars: Episode V The Empire Strikes Back \n", "1181 Star Wars: Episode V The Empire Strikes Back \n", "1182 Star Wars: Episode V The Empire Strikes Back \n", "1183 Star Wars: Episode V The Empire Strikes Back \n", "1184 NaN \n", "1185 Star Wars: Episode V The Empire Strikes Back \n", "1186 Star Wars: Episode V The Empire Strikes Back \n", "\n", " Unnamed: 8 \\\n", "0 Star Wars: Episode VI Return of the Jedi \n", "1 Star Wars: Episode VI Return of the Jedi \n", "2 NaN \n", "3 NaN \n", "4 Star Wars: Episode VI Return of the Jedi \n", "5 Star Wars: Episode VI Return of the Jedi \n", "6 Star Wars: Episode VI Return of the Jedi \n", "7 Star Wars: Episode VI Return of the Jedi \n", "8 Star Wars: Episode VI Return of the Jedi \n", "9 Star Wars: Episode VI Return of the Jedi \n", "10 NaN \n", "11 NaN \n", "12 NaN \n", "13 Star Wars: Episode VI Return of the Jedi \n", "14 Star Wars: Episode VI Return of the Jedi \n", "15 Star Wars: Episode VI Return of the Jedi \n", "16 Star Wars: Episode VI Return of the Jedi \n", "17 NaN \n", "18 Star Wars: Episode VI Return of the Jedi \n", "19 Star Wars: Episode VI Return of the Jedi \n", "20 Star Wars: Episode VI Return of the Jedi \n", "21 Star Wars: Episode VI Return of the Jedi \n", "22 NaN \n", "23 Star Wars: Episode VI Return of the Jedi \n", "24 Star Wars: Episode VI Return of the Jedi \n", "25 Star Wars: Episode VI Return of the Jedi \n", "26 NaN \n", "27 Star Wars: Episode VI Return of the Jedi \n", "28 Star Wars: Episode VI Return of the Jedi \n", "29 Star Wars: Episode VI Return of the Jedi \n", "... ... \n", "1157 Star Wars: Episode VI Return of the Jedi \n", "1158 NaN \n", "1159 Star Wars: Episode VI Return of the Jedi \n", "1160 NaN \n", "1161 Star Wars: Episode VI Return of the Jedi \n", "1162 Star Wars: Episode VI Return of the Jedi \n", "1163 Star Wars: Episode VI Return of the Jedi \n", "1164 Star Wars: Episode VI Return of the Jedi \n", "1165 Star Wars: Episode VI Return of the Jedi \n", "1166 Star Wars: Episode VI Return of the Jedi \n", "1167 Star Wars: Episode VI Return of the Jedi \n", "1168 Star Wars: Episode VI Return of the Jedi \n", "1169 NaN \n", "1170 Star Wars: Episode VI Return of the Jedi \n", "1171 NaN \n", "1172 Star Wars: Episode VI Return of the Jedi \n", "1173 Star Wars: Episode VI Return of the Jedi \n", "1174 Star Wars: Episode VI Return of the Jedi \n", "1175 NaN \n", "1176 Star Wars: Episode VI Return of the Jedi \n", "1177 NaN \n", "1178 Star Wars: Episode VI Return of the Jedi \n", "1179 NaN \n", "1180 Star Wars: Episode VI Return of the Jedi \n", "1181 Star Wars: Episode VI Return of the Jedi \n", "1182 Star Wars: Episode VI Return of the Jedi \n", "1183 Star Wars: Episode VI Return of the Jedi \n", "1184 NaN \n", "1185 Star Wars: Episode VI Return of the Jedi \n", "1186 Star Wars: Episode VI Return of the Jedi \n", "\n", " Please rank the Star Wars films in order of preference with 1 being your favorite film in the franchise and 6 being your least favorite film. \\\n", "0 Star Wars: Episode I The Phantom Menace \n", "1 3 \n", "2 NaN \n", "3 1 \n", "4 5 \n", "5 5 \n", "6 1 \n", "7 6 \n", "8 4 \n", "9 5 \n", "10 1 \n", "11 NaN \n", "12 NaN \n", "13 3 \n", "14 4 \n", "15 4 \n", "16 4 \n", "17 4 \n", "18 1 \n", "19 6 \n", "20 6 \n", "21 6 \n", "22 3 \n", "23 6 \n", "24 6 \n", "25 1 \n", "26 NaN \n", "27 4 \n", "28 6 \n", "29 6 \n", "... ... \n", "1157 3 \n", "1158 NaN \n", "1159 2 \n", "1160 NaN \n", "1161 3 \n", "1162 3 \n", "1163 4 \n", "1164 5 \n", "1165 5 \n", "1166 5 \n", "1167 6 \n", "1168 3 \n", "1169 NaN \n", "1170 4 \n", "1171 NaN \n", "1172 6 \n", "1173 2 \n", "1174 5 \n", "1175 1 \n", "1176 1 \n", "1177 2 \n", "1178 1 \n", "1179 NaN \n", "1180 3 \n", "1181 3 \n", "1182 5 \n", "1183 4 \n", "1184 NaN \n", "1185 4 \n", "1186 6 \n", "\n", " ... Unnamed: 28 \\\n", "0 ... Yoda \n", "1 ... Very favorably \n", "2 ... NaN \n", "3 ... Unfamiliar (N/A) \n", "4 ... Very favorably \n", "5 ... Somewhat favorably \n", "6 ... Very favorably \n", "7 ... Very favorably \n", "8 ... Very favorably \n", "9 ... Somewhat favorably \n", "10 ... Very favorably \n", "11 ... NaN \n", "12 ... NaN \n", "13 ... Very favorably \n", "14 ... Very favorably \n", "15 ... Very favorably \n", "16 ... Somewhat favorably \n", "17 ... Very unfavorably \n", "18 ... Very favorably \n", "19 ... Very favorably \n", "20 ... Very favorably \n", "21 ... Very favorably \n", "22 ... Neither favorably nor unfavorably (neutral) \n", "23 ... Very favorably \n", "24 ... Very favorably \n", "25 ... Very favorably \n", "26 ... NaN \n", "27 ... Very favorably \n", "28 ... Very favorably \n", "29 ... Very favorably \n", "... ... ... \n", "1157 ... Very favorably \n", "1158 ... NaN \n", "1159 ... Very favorably \n", "1160 ... NaN \n", "1161 ... Very favorably \n", "1162 ... Neither favorably nor unfavorably (neutral) \n", "1163 ... Very favorably \n", "1164 ... Very favorably \n", "1165 ... Neither favorably nor unfavorably (neutral) \n", "1166 ... Very favorably \n", "1167 ... Very favorably \n", "1168 ... Very favorably \n", "1169 ... NaN \n", "1170 ... Very favorably \n", "1171 ... NaN \n", "1172 ... Somewhat unfavorably \n", "1173 ... Somewhat favorably \n", "1174 ... Very favorably \n", "1175 ... Very favorably \n", "1176 ... Somewhat favorably \n", "1177 ... Neither favorably nor unfavorably (neutral) \n", "1178 ... Very favorably \n", "1179 ... NaN \n", "1180 ... Very favorably \n", "1181 ... Very favorably \n", "1182 ... Very favorably \n", "1183 ... Very favorably \n", "1184 ... NaN \n", "1185 ... Very favorably \n", "1186 ... Very unfavorably \n", "\n", " Which character shot first? \\\n", "0 Response \n", "1 I don't understand this question \n", "2 NaN \n", "3 I don't understand this question \n", "4 I don't understand this question \n", "5 Greedo \n", "6 Han \n", "7 Han \n", "8 Han \n", "9 Han \n", "10 I don't understand this question \n", "11 NaN \n", "12 NaN \n", "13 Greedo \n", "14 I don't understand this question \n", "15 Han \n", "16 Han \n", "17 Han \n", "18 Greedo \n", "19 Han \n", "20 Greedo \n", "21 Han \n", "22 I don't understand this question \n", "23 Greedo \n", "24 Han \n", "25 Han \n", "26 NaN \n", "27 Greedo \n", "28 Greedo \n", "29 Han \n", "... ... \n", "1157 I don't understand this question \n", "1158 NaN \n", "1159 I don't understand this question \n", "1160 NaN \n", "1161 I don't understand this question \n", "1162 Greedo \n", "1163 I don't understand this question \n", "1164 Han \n", "1165 Han \n", "1166 Greedo \n", "1167 I don't understand this question \n", "1168 Greedo \n", "1169 NaN \n", "1170 Han \n", "1171 NaN \n", "1172 Han \n", "1173 Greedo \n", "1174 Han \n", "1175 I don't understand this question \n", "1176 Han \n", "1177 I don't understand this question \n", "1178 I don't understand this question \n", "1179 NaN \n", "1180 Han \n", "1181 Han \n", "1182 Han \n", "1183 I don't understand this question \n", "1184 NaN \n", "1185 Han \n", "1186 I don't understand this question \n", "\n", " Are you familiar with the Expanded Universe? \\\n", "0 Response \n", "1 Yes \n", "2 NaN \n", "3 No \n", "4 No \n", "5 Yes \n", "6 Yes \n", "7 Yes \n", "8 No \n", "9 No \n", "10 No \n", "11 NaN \n", "12 NaN \n", "13 No \n", "14 No \n", "15 No \n", "16 Yes \n", "17 Yes \n", "18 No \n", "19 No \n", "20 No \n", "21 No \n", "22 No \n", "23 Yes \n", "24 No \n", "25 No \n", "26 NaN \n", "27 Yes \n", "28 No \n", "29 Yes \n", "... ... \n", "1157 No \n", "1158 NaN \n", "1159 No \n", "1160 NaN \n", "1161 No \n", "1162 No \n", "1163 No \n", "1164 Yes \n", "1165 No \n", "1166 No \n", "1167 No \n", "1168 Yes \n", "1169 NaN \n", "1170 No \n", "1171 NaN \n", "1172 Yes \n", "1173 Yes \n", "1174 No \n", "1175 No \n", "1176 Yes \n", "1177 No \n", "1178 No \n", "1179 NaN \n", "1180 No \n", "1181 No \n", "1182 No \n", "1183 No \n", "1184 NaN \n", "1185 No \n", "1186 No \n", "\n", " Do you consider yourself to be a fan of the Expanded Universe?�� \\\n", "0 Response \n", "1 No \n", "2 NaN \n", "3 NaN \n", "4 NaN \n", "5 No \n", "6 No \n", "7 No \n", "8 NaN \n", "9 NaN \n", "10 NaN \n", "11 NaN \n", "12 NaN \n", "13 NaN \n", "14 NaN \n", "15 NaN \n", "16 Yes \n", "17 Yes \n", "18 NaN \n", "19 NaN \n", "20 NaN \n", "21 NaN \n", "22 NaN \n", "23 Yes \n", "24 NaN \n", "25 NaN \n", "26 NaN \n", "27 No \n", "28 NaN \n", "29 No \n", "... ... \n", "1157 NaN \n", "1158 NaN \n", "1159 NaN \n", "1160 NaN \n", "1161 NaN \n", "1162 NaN \n", "1163 NaN \n", "1164 No \n", "1165 NaN \n", "1166 NaN \n", "1167 NaN \n", "1168 No \n", "1169 NaN \n", "1170 NaN \n", "1171 NaN \n", "1172 Yes \n", "1173 No \n", "1174 NaN \n", "1175 NaN \n", "1176 No \n", "1177 NaN \n", "1178 NaN \n", "1179 NaN \n", "1180 NaN \n", "1181 NaN \n", "1182 NaN \n", "1183 NaN \n", "1184 NaN \n", "1185 NaN \n", "1186 NaN \n", "\n", " Do you consider yourself to be a fan of the Star Trek franchise? \\\n", "0 Response \n", "1 No \n", "2 Yes \n", "3 No \n", "4 Yes \n", "5 No \n", "6 Yes \n", "7 No \n", "8 Yes \n", "9 No \n", "10 No \n", "11 NaN \n", "12 NaN \n", "13 No \n", "14 No \n", "15 No \n", "16 Yes \n", "17 No \n", "18 No \n", "19 No \n", "20 Yes \n", "21 No \n", "22 No \n", "23 Yes \n", "24 No \n", "25 No \n", "26 Yes \n", "27 No \n", "28 No \n", "29 No \n", "... ... \n", "1157 No \n", "1158 No \n", "1159 No \n", "1160 No \n", "1161 No \n", "1162 No \n", "1163 No \n", "1164 No \n", "1165 No \n", "1166 Yes \n", "1167 No \n", "1168 No \n", "1169 No \n", "1170 Yes \n", "1171 No \n", "1172 Yes \n", "1173 Yes \n", "1174 Yes \n", "1175 Yes \n", "1176 Yes \n", "1177 No \n", "1178 Yes \n", "1179 No \n", "1180 Yes \n", "1181 No \n", "1182 Yes \n", "1183 Yes \n", "1184 No \n", "1185 Yes \n", "1186 No \n", "\n", " Gender Age Household Income \\\n", "0 Response Response Response \n", "1 Male 18-29 NaN \n", "2 Male 18-29 $0 - $24,999 \n", "3 Male 18-29 $0 - $24,999 \n", "4 Male 18-29 $100,000 - $149,999 \n", "5 Male 18-29 $100,000 - $149,999 \n", "6 Male 18-29 $25,000 - $49,999 \n", "7 Male 18-29 NaN \n", "8 Male 18-29 NaN \n", "9 Male 18-29 $0 - $24,999 \n", "10 Male 18-29 $25,000 - $49,999 \n", "11 NaN NaN NaN \n", "12 NaN NaN NaN \n", "13 Male 18-29 $25,000 - $49,999 \n", "14 Male 30-44 $50,000 - $99,999 \n", "15 Male 18-29 NaN \n", "16 Male 18-29 $0 - $24,999 \n", "17 Male 18-29 $50,000 - $99,999 \n", "18 Male 18-29 NaN \n", "19 Male 18-29 NaN \n", "20 Male 18-29 $50,000 - $99,999 \n", "21 Male 18-29 NaN \n", "22 Male 18-29 NaN \n", "23 Male 18-29 $50,000 - $99,999 \n", "24 Male 18-29 $0 - $24,999 \n", "25 Male 18-29 NaN \n", "26 Male 18-29 $0 - $24,999 \n", "27 Male 18-29 $100,000 - $149,999 \n", "28 Male 18-29 NaN \n", "29 Male 18-29 NaN \n", "... ... ... ... \n", "1157 Female 30-44 $50,000 - $99,999 \n", "1158 Male 45-60 $100,000 - $149,999 \n", "1159 Female 45-60 $0 - $24,999 \n", "1160 Female > 60 $0 - $24,999 \n", "1161 Female 18-29 $25,000 - $49,999 \n", "1162 NaN NaN NaN \n", "1163 Female 18-29 $25,000 - $49,999 \n", "1164 Female > 60 NaN \n", "1165 Male 45-60 $100,000 - $149,999 \n", "1166 Female 30-44 $50,000 - $99,999 \n", "1167 Female 18-29 $150,000+ \n", "1168 Female 30-44 NaN \n", "1169 Female 30-44 $150,000+ \n", "1170 Male 45-60 $25,000 - $49,999 \n", "1171 Female 45-60 NaN \n", "1172 Female > 60 $25,000 - $49,999 \n", "1173 Female > 60 NaN \n", "1174 Female 30-44 NaN \n", "1175 Female > 60 NaN \n", "1176 Female 45-60 $50,000 - $99,999 \n", "1177 Female 45-60 $0 - $24,999 \n", "1178 Male > 60 $50,000 - $99,999 \n", "1179 Female 18-29 NaN \n", "1180 Female 45-60 $0 - $24,999 \n", "1181 Female 45-60 $0 - $24,999 \n", "1182 Female 18-29 $0 - $24,999 \n", "1183 Female 30-44 $50,000 - $99,999 \n", "1184 Female 30-44 $50,000 - $99,999 \n", "1185 Female 45-60 $100,000 - $149,999 \n", "1186 Female > 60 $50,000 - $99,999 \n", "\n", " Education Location (Census Region) \n", "0 Response Response \n", "1 High school degree South Atlantic \n", "2 Bachelor degree West South Central \n", "3 High school degree West North Central \n", "4 Some college or Associate degree West North Central \n", "5 Some college or Associate degree West North Central \n", "6 Bachelor degree Middle Atlantic \n", "7 High school degree East North Central \n", "8 High school degree South Atlantic \n", "9 Some college or Associate degree South Atlantic \n", "10 Some college or Associate degree Pacific \n", "11 NaN NaN \n", "12 NaN NaN \n", "13 Bachelor degree South Atlantic \n", "14 Graduate degree Mountain \n", "15 High school degree East North Central \n", "16 Some college or Associate degree West South Central \n", "17 Bachelor degree New England \n", "18 Some college or Associate degree Middle Atlantic \n", "19 High school degree South Atlantic \n", "20 Some college or Associate degree West North Central \n", "21 Some college or Associate degree Pacific \n", "22 Bachelor degree Pacific \n", "23 Bachelor degree South Atlantic \n", "24 Bachelor degree Pacific \n", "25 NaN East North Central \n", "26 High school degree East South Central \n", "27 Some college or Associate degree South Atlantic \n", "28 Some college or Associate degree Middle Atlantic \n", "29 Some college or Associate degree Middle Atlantic \n", "... ... ... \n", "1157 Graduate degree Middle Atlantic \n", "1158 Graduate degree Middle Atlantic \n", "1159 Bachelor degree Pacific \n", "1160 Some college or Associate degree West South Central \n", "1161 Some college or Associate degree Pacific \n", "1162 NaN NaN \n", "1163 Graduate degree South Atlantic \n", "1164 Bachelor degree New England \n", "1165 Graduate degree Middle Atlantic \n", "1166 Bachelor degree Mountain \n", "1167 Some college or Associate degree South Atlantic \n", "1168 Graduate degree East North Central \n", "1169 Graduate degree East North Central \n", "1170 Bachelor degree South Atlantic \n", "1171 Graduate degree East North Central \n", "1172 Bachelor degree Mountain \n", "1173 High school degree Pacific \n", "1174 Bachelor degree Middle Atlantic \n", "1175 Some college or Associate degree West North Central \n", "1176 Graduate degree West South Central \n", "1177 High school degree Middle Atlantic \n", "1178 Some college or Associate degree Pacific \n", "1179 Less than high school degree West North Central \n", "1180 Some college or Associate degree West North Central \n", "1181 Some college or Associate degree Pacific \n", "1182 Some college or Associate degree East North Central \n", "1183 Bachelor degree Mountain \n", "1184 Bachelor degree Middle Atlantic \n", "1185 Some college or Associate degree East North Central \n", "1186 Graduate degree Pacific \n", "\n", "[1187 rows x 38 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd # Por convención lo importamos como pd, porque escribir pandas cada dos lineas es demasiado\n", "\n", "t = pd.read_csv('StarWars.csv')\n", "t" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Para empezar la tabla quedó formateada automáticamente. Podemos hacer algunas estadisticas sencillas como" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Yes 936\n", "No 250\n", "Response 1\n", "Name: Have you seen any of the 6 films in the Star Wars franchise?, dtype: int64" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# De las 1187 personas encuestadas ¿Cuantas han visto alguna película de Star Wars?\n", "\n", "t['Have you seen any of the 6 films in the Star Wars franchise?'].value_counts()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "O podemos saber muy fácilmente cual, segun nuestros datos, es la pelicula más vista de Star Wars es Empire Strikes Back" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": 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", "
countuniquetopfreq
Which of the following Star Wars films have you seen? Please select all that apply.6741Star Wars: Episode I The Phantom Menace674
Unnamed: 45721Star Wars: Episode II Attack of the Clones572
Unnamed: 55511Star Wars: Episode III Revenge of the Sith551
Unnamed: 66081Star Wars: Episode IV A New Hope608
Unnamed: 77591Star Wars: Episode V The Empire Strikes Back759
Unnamed: 87391Star Wars: Episode VI Return of the Jedi739
\n", "
" ], "text/plain": [ " count unique \\\n", "Which of the following Star Wars films have you... 674 1 \n", "Unnamed: 4 572 1 \n", "Unnamed: 5 551 1 \n", "Unnamed: 6 608 1 \n", "Unnamed: 7 759 1 \n", "Unnamed: 8 739 1 \n", "\n", " top \\\n", "Which of the following Star Wars films have you... Star Wars: Episode I The Phantom Menace \n", "Unnamed: 4 Star Wars: Episode II Attack of the Clones \n", "Unnamed: 5 Star Wars: Episode III Revenge of the Sith \n", "Unnamed: 6 Star Wars: Episode IV A New Hope \n", "Unnamed: 7 Star Wars: Episode V The Empire Strikes Back \n", "Unnamed: 8 Star Wars: Episode VI Return of the Jedi \n", "\n", " freq \n", "Which of the following Star Wars films have you... 674 \n", "Unnamed: 4 572 \n", "Unnamed: 5 551 \n", "Unnamed: 6 608 \n", "Unnamed: 7 759 \n", "Unnamed: 8 739 " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "watched = t.iloc[:, 3:9].describe().transpose()\n", "watched" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Hacer Gráficas" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " Loading BokehJS ...\n", "
" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "\n", "(function(root) {\n", " function now() {\n", " return new Date();\n", " }\n", "\n", " var force = true;\n", "\n", " if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n", " root._bokeh_onload_callbacks = [];\n", " root._bokeh_is_loading = undefined;\n", " }\n", "\n", " var JS_MIME_TYPE = 'application/javascript';\n", " var HTML_MIME_TYPE = 'text/html';\n", " var EXEC_MIME_TYPE = 'application/vnd.bokehjs_exec.v0+json';\n", " var CLASS_NAME = 'output_bokeh rendered_html';\n", "\n", " /**\n", " * Render data to the DOM node\n", " */\n", " function render(props, node) {\n", " var script = document.createElement(\"script\");\n", " node.appendChild(script);\n", " }\n", "\n", " /**\n", " * Handle when an output is cleared or removed\n", " */\n", " function handleClearOutput(event, handle) {\n", " var cell = handle.cell;\n", "\n", " var id = cell.output_area._bokeh_element_id;\n", " var server_id = cell.output_area._bokeh_server_id;\n", " // Clean up Bokeh references\n", " if (id != null && id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", "\n", " if (server_id !== undefined) {\n", " // Clean up Bokeh references\n", " var cmd = \"from bokeh.io.state import curstate; print(curstate().uuid_to_server['\" + server_id + \"'].get_sessions()[0].document.roots[0]._id)\";\n", " cell.notebook.kernel.execute(cmd, {\n", " iopub: {\n", " output: function(msg) {\n", " var id = msg.content.text.trim();\n", " if (id in Bokeh.index) {\n", " Bokeh.index[id].model.document.clear();\n", " delete Bokeh.index[id];\n", " }\n", " }\n", " }\n", " });\n", " // Destroy server and session\n", " var cmd = \"import bokeh.io.notebook as ion; ion.destroy_server('\" + server_id + \"')\";\n", " cell.notebook.kernel.execute(cmd);\n", " }\n", " }\n", "\n", " /**\n", " * Handle when a new output is added\n", " */\n", " function handleAddOutput(event, handle) {\n", " var output_area = handle.output_area;\n", " var output = handle.output;\n", "\n", " // limit handleAddOutput to display_data with EXEC_MIME_TYPE content only\n", " if ((output.output_type != \"display_data\") || (!output.data.hasOwnProperty(EXEC_MIME_TYPE))) {\n", " return\n", " }\n", "\n", " var toinsert = output_area.element.find(\".\" + CLASS_NAME.split(' ')[0]);\n", "\n", " if (output.metadata[EXEC_MIME_TYPE][\"id\"] !== undefined) {\n", " toinsert[toinsert.length - 1].firstChild.textContent = output.data[JS_MIME_TYPE];\n", " // store reference to embed id on output_area\n", " output_area._bokeh_element_id = output.metadata[EXEC_MIME_TYPE][\"id\"];\n", " }\n", " if (output.metadata[EXEC_MIME_TYPE][\"server_id\"] !== undefined) {\n", " var bk_div = document.createElement(\"div\");\n", " bk_div.innerHTML = output.data[HTML_MIME_TYPE];\n", " var script_attrs = bk_div.children[0].attributes;\n", " for (var i = 0; i < script_attrs.length; i++) {\n", " toinsert[toinsert.length - 1].firstChild.setAttribute(script_attrs[i].name, script_attrs[i].value);\n", " }\n", " // store reference to server id on output_area\n", " output_area._bokeh_server_id = output.metadata[EXEC_MIME_TYPE][\"server_id\"];\n", " }\n", " }\n", "\n", " function register_renderer(events, OutputArea) {\n", "\n", " function append_mime(data, metadata, element) {\n", " // create a DOM node to render to\n", " var toinsert = this.create_output_subarea(\n", " metadata,\n", " CLASS_NAME,\n", " EXEC_MIME_TYPE\n", " );\n", " this.keyboard_manager.register_events(toinsert);\n", " // Render to node\n", " var props = {data: data, metadata: metadata[EXEC_MIME_TYPE]};\n", " render(props, toinsert[toinsert.length - 1]);\n", " element.append(toinsert);\n", " return toinsert\n", " }\n", "\n", " /* Handle when an output is cleared or removed */\n", " events.on('clear_output.CodeCell', handleClearOutput);\n", " events.on('delete.Cell', handleClearOutput);\n", "\n", " /* Handle when a new output is added */\n", " events.on('output_added.OutputArea', handleAddOutput);\n", "\n", " /**\n", " * Register the mime type and append_mime function with output_area\n", " */\n", " OutputArea.prototype.register_mime_type(EXEC_MIME_TYPE, append_mime, {\n", " /* Is output safe? */\n", " safe: true,\n", " /* Index of renderer in `output_area.display_order` */\n", " index: 0\n", " });\n", " }\n", "\n", " // register the mime type if in Jupyter Notebook environment and previously unregistered\n", " if (root.Jupyter !== undefined) {\n", " var events = require('base/js/events');\n", " var OutputArea = require('notebook/js/outputarea').OutputArea;\n", "\n", " if (OutputArea.prototype.mime_types().indexOf(EXEC_MIME_TYPE) == -1) {\n", " register_renderer(events, OutputArea);\n", " }\n", " }\n", "\n", " \n", " if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n", " root._bokeh_timeout = Date.now() + 5000;\n", " root._bokeh_failed_load = false;\n", " }\n", "\n", " var NB_LOAD_WARNING = {'data': {'text/html':\n", " \"
\\n\"+\n", " \"

\\n\"+\n", " \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n", " \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n", " \"

\\n\"+\n", " \"\\n\"+\n", " \"\\n\"+\n", " \"from bokeh.resources import INLINE\\n\"+\n", " \"output_notebook(resources=INLINE)\\n\"+\n", " \"\\n\"+\n", " \"
\"}};\n", "\n", " function display_loaded() {\n", " var el = document.getElementById(\"1001\");\n", " if (el != null) {\n", " el.textContent = \"BokehJS is loading...\";\n", " }\n", " if (root.Bokeh !== undefined) {\n", " if (el != null) {\n", " el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n", " }\n", " } else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(display_loaded, 100)\n", " }\n", " }\n", "\n", "\n", " function run_callbacks() {\n", " try {\n", " root._bokeh_onload_callbacks.forEach(function(callback) {\n", " if (callback != null)\n", " callback();\n", " });\n", " } finally {\n", " delete root._bokeh_onload_callbacks\n", " }\n", " console.debug(\"Bokeh: all callbacks have finished\");\n", " }\n", "\n", " function load_libs(css_urls, js_urls, callback) {\n", " if (css_urls == null) css_urls = [];\n", " if (js_urls == null) js_urls = [];\n", "\n", " root._bokeh_onload_callbacks.push(callback);\n", " if (root._bokeh_is_loading > 0) {\n", " console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n", " return null;\n", " }\n", " if (js_urls == null || js_urls.length === 0) {\n", " run_callbacks();\n", " return null;\n", " }\n", " console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n", " root._bokeh_is_loading = css_urls.length + js_urls.length;\n", "\n", " function on_load() {\n", " root._bokeh_is_loading--;\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n", " run_callbacks()\n", " }\n", " }\n", "\n", " function on_error() {\n", " console.error(\"failed to load \" + url);\n", " }\n", "\n", " for (var i = 0; i < css_urls.length; i++) {\n", " var url = css_urls[i];\n", " const element = document.createElement(\"link\");\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.rel = \"stylesheet\";\n", " element.type = \"text/css\";\n", " element.href = url;\n", " console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n", " document.body.appendChild(element);\n", " }\n", "\n", " for (var i = 0; i < js_urls.length; i++) {\n", " var url = js_urls[i];\n", " var element = document.createElement('script');\n", " element.onload = on_load;\n", " element.onerror = on_error;\n", " element.async = false;\n", " element.src = url;\n", " console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n", " document.head.appendChild(element);\n", " }\n", " };var element = document.getElementById(\"1001\");\n", " if (element == null) {\n", " console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n", " return false;\n", " }\n", "\n", " function inject_raw_css(css) {\n", " const element = document.createElement(\"style\");\n", " element.appendChild(document.createTextNode(css));\n", " document.body.appendChild(element);\n", " }\n", "\n", " var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.1.0.min.js\"];\n", " var css_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.css\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.css\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.1.0.min.css\"];\n", "\n", " var inline_js = [\n", " function(Bokeh) {\n", " Bokeh.set_log_level(\"info\");\n", " },\n", " \n", " function(Bokeh) {\n", " \n", " },\n", " function(Bokeh) {} // ensure no trailing comma for IE\n", " ];\n", "\n", " function run_inline_js() {\n", " \n", " if ((root.Bokeh !== undefined) || (force === true)) {\n", " for (var i = 0; i < inline_js.length; i++) {\n", " inline_js[i].call(root, root.Bokeh);\n", " }if (force === true) {\n", " display_loaded();\n", " }} else if (Date.now() < root._bokeh_timeout) {\n", " setTimeout(run_inline_js, 100);\n", " } else if (!root._bokeh_failed_load) {\n", " console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n", " root._bokeh_failed_load = true;\n", " } else if (force !== true) {\n", " var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n", " cell.output_area.append_execute_result(NB_LOAD_WARNING)\n", " }\n", "\n", " }\n", "\n", " if (root._bokeh_is_loading === 0) {\n", " console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n", " run_inline_js();\n", " } else {\n", " load_libs(css_urls, js_urls, function() {\n", " console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n", " run_inline_js();\n", " });\n", " }\n", "}(window));" ], "application/vnd.bokehjs_load.v0+json": "\n(function(root) {\n function now() {\n return new Date();\n }\n\n var force = true;\n\n if (typeof root._bokeh_onload_callbacks === \"undefined\" || force === true) {\n root._bokeh_onload_callbacks = [];\n root._bokeh_is_loading = undefined;\n }\n\n \n\n \n if (typeof (root._bokeh_timeout) === \"undefined\" || force === true) {\n root._bokeh_timeout = Date.now() + 5000;\n root._bokeh_failed_load = false;\n }\n\n var NB_LOAD_WARNING = {'data': {'text/html':\n \"
\\n\"+\n \"

\\n\"+\n \"BokehJS does not appear to have successfully loaded. If loading BokehJS from CDN, this \\n\"+\n \"may be due to a slow or bad network connection. Possible fixes:\\n\"+\n \"

\\n\"+\n \"\\n\"+\n \"\\n\"+\n \"from bokeh.resources import INLINE\\n\"+\n \"output_notebook(resources=INLINE)\\n\"+\n \"\\n\"+\n \"
\"}};\n\n function display_loaded() {\n var el = document.getElementById(\"1001\");\n if (el != null) {\n el.textContent = \"BokehJS is loading...\";\n }\n if (root.Bokeh !== undefined) {\n if (el != null) {\n el.textContent = \"BokehJS \" + root.Bokeh.version + \" successfully loaded.\";\n }\n } else if (Date.now() < root._bokeh_timeout) {\n setTimeout(display_loaded, 100)\n }\n }\n\n\n function run_callbacks() {\n try {\n root._bokeh_onload_callbacks.forEach(function(callback) {\n if (callback != null)\n callback();\n });\n } finally {\n delete root._bokeh_onload_callbacks\n }\n console.debug(\"Bokeh: all callbacks have finished\");\n }\n\n function load_libs(css_urls, js_urls, callback) {\n if (css_urls == null) css_urls = [];\n if (js_urls == null) js_urls = [];\n\n root._bokeh_onload_callbacks.push(callback);\n if (root._bokeh_is_loading > 0) {\n console.debug(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n return null;\n }\n if (js_urls == null || js_urls.length === 0) {\n run_callbacks();\n return null;\n }\n console.debug(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n root._bokeh_is_loading = css_urls.length + js_urls.length;\n\n function on_load() {\n root._bokeh_is_loading--;\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: all BokehJS libraries/stylesheets loaded\");\n run_callbacks()\n }\n }\n\n function on_error() {\n console.error(\"failed to load \" + url);\n }\n\n for (var i = 0; i < css_urls.length; i++) {\n var url = css_urls[i];\n const element = document.createElement(\"link\");\n element.onload = on_load;\n element.onerror = on_error;\n element.rel = \"stylesheet\";\n element.type = \"text/css\";\n element.href = url;\n console.debug(\"Bokeh: injecting link tag for BokehJS stylesheet: \", url);\n document.body.appendChild(element);\n }\n\n for (var i = 0; i < js_urls.length; i++) {\n var url = js_urls[i];\n var element = document.createElement('script');\n element.onload = on_load;\n element.onerror = on_error;\n element.async = false;\n element.src = url;\n console.debug(\"Bokeh: injecting script tag for BokehJS library: \", url);\n document.head.appendChild(element);\n }\n };var element = document.getElementById(\"1001\");\n if (element == null) {\n console.error(\"Bokeh: ERROR: autoload.js configured with elementid '1001' but no matching script tag was found. \")\n return false;\n }\n\n function inject_raw_css(css) {\n const element = document.createElement(\"style\");\n element.appendChild(document.createTextNode(css));\n document.body.appendChild(element);\n }\n\n var js_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.1.0.min.js\", \"https://cdn.pydata.org/bokeh/release/bokeh-gl-1.1.0.min.js\"];\n var css_urls = [\"https://cdn.pydata.org/bokeh/release/bokeh-1.1.0.min.css\", \"https://cdn.pydata.org/bokeh/release/bokeh-widgets-1.1.0.min.css\", \"https://cdn.pydata.org/bokeh/release/bokeh-tables-1.1.0.min.css\"];\n\n var inline_js = [\n function(Bokeh) {\n Bokeh.set_log_level(\"info\");\n },\n \n function(Bokeh) {\n \n },\n function(Bokeh) {} // ensure no trailing comma for IE\n ];\n\n function run_inline_js() {\n \n if ((root.Bokeh !== undefined) || (force === true)) {\n for (var i = 0; i < inline_js.length; i++) {\n inline_js[i].call(root, root.Bokeh);\n }if (force === true) {\n display_loaded();\n }} else if (Date.now() < root._bokeh_timeout) {\n setTimeout(run_inline_js, 100);\n } else if (!root._bokeh_failed_load) {\n console.log(\"Bokeh: BokehJS failed to load within specified timeout.\");\n root._bokeh_failed_load = true;\n } else if (force !== true) {\n var cell = $(document.getElementById(\"1001\")).parents('.cell').data().cell;\n cell.output_area.append_execute_result(NB_LOAD_WARNING)\n }\n\n }\n\n if (root._bokeh_is_loading === 0) {\n console.debug(\"Bokeh: BokehJS loaded, going straight to plotting\");\n run_inline_js();\n } else {\n load_libs(css_urls, js_urls, function() {\n console.debug(\"Bokeh: BokehJS plotting callback run at\", now());\n run_inline_js();\n });\n }\n}(window));" }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/javascript": [ "(function(root) {\n", " function embed_document(root) {\n", " \n", " var docs_json = {\"122dd115-f58a-4965-baed-35c38e114deb\":{\"roots\":{\"references\":[{\"attributes\":{\"below\":[{\"id\":\"1014\",\"type\":\"LinearAxis\"}],\"center\":[{\"id\":\"1018\",\"type\":\"Grid\"},{\"id\":\"1022\",\"type\":\"Grid\"},{\"id\":\"1003\",\"type\":\"LabelSet\"}],\"left\":[{\"id\":\"1019\",\"type\":\"CategoricalAxis\"}],\"plot_width\":850,\"renderers\":[{\"id\":\"1039\",\"type\":\"GlyphRenderer\"}],\"title\":{\"id\":\"1042\",\"type\":\"Title\"},\"toolbar\":{\"id\":\"1029\",\"type\":\"Toolbar\"},\"x_range\":{\"id\":\"1006\",\"type\":\"DataRange1d\"},\"x_scale\":{\"id\":\"1010\",\"type\":\"LinearScale\"},\"y_range\":{\"id\":\"1008\",\"type\":\"FactorRange\"},\"y_scale\":{\"id\":\"1012\",\"type\":\"CategoricalScale\"}},\"id\":\"1005\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{},\"id\":\"1026\",\"type\":\"SaveTool\"},{\"attributes\":{\"active_drag\":\"auto\",\"active_inspect\":\"auto\",\"active_multi\":null,\"active_scroll\":\"auto\",\"active_tap\":\"auto\",\"tools\":[{\"id\":\"1023\",\"type\":\"PanTool\"},{\"id\":\"1024\",\"type\":\"WheelZoomTool\"},{\"id\":\"1025\",\"type\":\"BoxZoomTool\"},{\"id\":\"1026\",\"type\":\"SaveTool\"},{\"id\":\"1027\",\"type\":\"ResetTool\"},{\"id\":\"1028\",\"type\":\"HelpTool\"}]},\"id\":\"1029\",\"type\":\"Toolbar\"},{\"attributes\":{},\"id\":\"1027\",\"type\":\"ResetTool\"},{\"attributes\":{\"callback\":null,\"data\":{\"freq\":[674,572,551,608,759,739],\"right\":[674,572,551,608,759,739],\"y\":[\"Star Wars: Episode I The Phantom Menace\",\"Star Wars: Episode II Attack of the Clones\",\"Star Wars: Episode III Revenge of the Sith\",\"Star Wars: Episode IV A New Hope\",\"Star Wars: Episode V The Empire Strikes Back\",\"Star Wars: Episode VI Return of the Jedi\"]},\"selected\":{\"id\":\"1049\",\"type\":\"Selection\"},\"selection_policy\":{\"id\":\"1048\",\"type\":\"UnionRenderers\"}},\"id\":\"1002\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"1028\",\"type\":\"HelpTool\"},{\"attributes\":{\"fill_alpha\":{\"value\":0.1},\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.5},\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"right\"},\"y\":{\"field\":\"y\"}},\"id\":\"1038\",\"type\":\"HBar\"},{\"attributes\":{\"callback\":null},\"id\":\"1006\",\"type\":\"DataRange1d\"},{\"attributes\":{\"source\":{\"id\":\"1002\",\"type\":\"ColumnDataSource\"}},\"id\":\"1040\",\"type\":\"CDSView\"},{\"attributes\":{\"callback\":null,\"factors\":[\"Star Wars: Episode I The Phantom Menace\",\"Star Wars: Episode II Attack of the Clones\",\"Star Wars: Episode III Revenge of the Sith\",\"Star Wars: Episode IV A New Hope\",\"Star Wars: Episode V The Empire Strikes Back\",\"Star Wars: Episode VI Return of the Jedi\"]},\"id\":\"1008\",\"type\":\"FactorRange\"},{\"attributes\":{},\"id\":\"1010\",\"type\":\"LinearScale\"},{\"attributes\":{},\"id\":\"1043\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{},\"id\":\"1012\",\"type\":\"CategoricalScale\"},{\"attributes\":{},\"id\":\"1046\",\"type\":\"CategoricalTickFormatter\"},{\"attributes\":{\"formatter\":{\"id\":\"1043\",\"type\":\"BasicTickFormatter\"},\"ticker\":{\"id\":\"1015\",\"type\":\"BasicTicker\"}},\"id\":\"1014\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"1024\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"1047\",\"type\":\"BoxAnnotation\"},{\"attributes\":{},\"id\":\"1048\",\"type\":\"UnionRenderers\"},{\"attributes\":{},\"id\":\"1015\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"1049\",\"type\":\"Selection\"},{\"attributes\":{\"ticker\":{\"id\":\"1015\",\"type\":\"BasicTicker\"}},\"id\":\"1018\",\"type\":\"Grid\"},{\"attributes\":{\"dimension\":1,\"ticker\":{\"id\":\"1020\",\"type\":\"CategoricalTicker\"}},\"id\":\"1022\",\"type\":\"Grid\"},{\"attributes\":{\"formatter\":{\"id\":\"1046\",\"type\":\"CategoricalTickFormatter\"},\"ticker\":{\"id\":\"1020\",\"type\":\"CategoricalTicker\"}},\"id\":\"1019\",\"type\":\"CategoricalAxis\"},{\"attributes\":{},\"id\":\"1020\",\"type\":\"CategoricalTicker\"},{\"attributes\":{\"data_source\":{\"id\":\"1002\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"1037\",\"type\":\"HBar\"},\"hover_glyph\":null,\"muted_glyph\":null,\"nonselection_glyph\":{\"id\":\"1038\",\"type\":\"HBar\"},\"selection_glyph\":null,\"view\":{\"id\":\"1040\",\"type\":\"CDSView\"}},\"id\":\"1039\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"fill_color\":{\"value\":\"#1f77b4\"},\"height\":{\"value\":0.5},\"line_color\":{\"value\":\"#1f77b4\"},\"right\":{\"field\":\"right\"},\"y\":{\"field\":\"y\"}},\"id\":\"1037\",\"type\":\"HBar\"},{\"attributes\":{\"level\":\"glyph\",\"source\":{\"id\":\"1002\",\"type\":\"ColumnDataSource\"},\"text\":{\"field\":\"freq\"},\"x\":{\"field\":\"right\"},\"x_offset\":{\"value\":2},\"y\":{\"field\":\"y\"},\"y_offset\":{\"value\":5}},\"id\":\"1003\",\"type\":\"LabelSet\"},{\"attributes\":{\"text\":\"\"},\"id\":\"1042\",\"type\":\"Title\"},{\"attributes\":{},\"id\":\"1023\",\"type\":\"PanTool\"},{\"attributes\":{\"overlay\":{\"id\":\"1047\",\"type\":\"BoxAnnotation\"}},\"id\":\"1025\",\"type\":\"BoxZoomTool\"}],\"root_ids\":[\"1005\"]},\"title\":\"Bokeh Application\",\"version\":\"1.1.0\"}};\n", " var render_items = [{\"docid\":\"122dd115-f58a-4965-baed-35c38e114deb\",\"roots\":{\"1005\":\"e91f0d90-b637-43bd-941d-3cf6806ecc17\"}}];\n", " root.Bokeh.embed.embed_items_notebook(docs_json, render_items);\n", "\n", " }\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " } else {\n", " var attempts = 0;\n", " var timer = setInterval(function(root) {\n", " if (root.Bokeh !== undefined) {\n", " embed_document(root);\n", " clearInterval(timer);\n", " }\n", " attempts++;\n", " if (attempts > 100) {\n", " console.log(\"Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing\");\n", " clearInterval(timer);\n", " }\n", " }, 10, root)\n", " }\n", "})(window);" ], "application/vnd.bokehjs_exec.v0+json": "" }, "metadata": { "application/vnd.bokehjs_exec.v0+json": { "id": "1005" } }, "output_type": "display_data" } ], "source": [ "from bokeh.plotting import figure, output_notebook, show\n", "from bokeh.models import ColumnDataSource,LabelSet\n", "output_notebook()\n", "\n", "\n", "source = ColumnDataSource(data=dict(y=watched[\"top\"],\n", " right=watched[\"freq\"],\n", " freq=watched[\"freq\"]))\n", "\n", "labels = LabelSet(x='right', y='y', text='freq', level='glyph',\n", " x_offset=2, y_offset=5, source=source, render_mode='canvas')\n", "\n", "p = figure(plot_width=850, y_range=watched['top'])\n", "\n", "p.hbar(y=\"y\", right=\"right\", height=0.5, source=source)\n", "p.add_layout(labels)\n", "show(p)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Mostrar mapas\n", "\n", "Solo tienes que activar [este](https://github.com/jupyterlab/jupyter-renderers/tree/master/packages/geojson-extension) complemento de Jupyter.\n", "\n", "```bash\n", "jupyter labextension install @jupyterlab/geojson-extension\n", "```\n", "\n", "Después de agregarlo solo tienes que importar el [display](https://ipython.readthedocs.io/en/stable/api/generated/IPython.display.html) de GeoJSON y tus mapas se mostrarán automáticamente" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "application/geo+json": { "features": [ { "geometry": { "coordinates": [ -98.20627212524414, 19.048082808795396 ], "type": "Point" }, "properties": {}, "type": "Feature" }, { "geometry": { "coordinates": [ -98.20215225219725, 19.054978803148376 ], "type": "Point" }, "properties": {}, "type": "Feature" }, { "geometry": { "coordinates": [ -98.21605682373047, 19.061793386528766 ], "type": "Point" }, "properties": {}, "type": "Feature" }, { "geometry": { "coordinates": [ -98.22275161743164, 19.05359962720829 ], "type": "Point" }, "properties": {}, "type": "Feature" }, { "geometry": { "coordinates": [ -98.23159217834473, 19.0492997698019 ], "type": "Point" }, "properties": {}, "type": "Feature" }, { "geometry": { "coordinates": [ -98.23433876037598, 19.046703575532554 ], "type": "Point" }, "properties": {}, "type": "Feature" }, { "geometry": { "coordinates": [ -98.21288108825684, 19.03639952912028 ], "type": "Point" }, "properties": {}, "type": "Feature" }, { "geometry": { "coordinates": [ [ [ -98.23416709899902, 19.04662244380717 ], [ -98.21296691894531, 19.03672407576917 ], [ -98.20635795593262, 19.048407332603105 ], [ -98.20206642150879, 19.055141058387473 ], [ -98.21648597717285, 19.062523503853996 ], [ -98.22223663330077, 19.053761883796376 ], [ -98.23142051696776, 19.0492997698019 ], [ -98.23416709899902, 19.04662244380717 ] ] ], "type": "Polygon" }, "properties": { "fill": "#00fcff", "fill-opacity": 0.5, "stroke": "#00fcff", "stroke-opacity": 1, "stroke-width": 2 }, "type": "Feature" } ], "type": "FeatureCollection" }, "text/plain": [ "" ] }, "metadata": { "application/geo+json": { "expanded": false, "root": "root" } }, "output_type": "display_data" } ], "source": [ "from IPython.display import GeoJSON\n", "GeoJSON({\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-98.20627212524414,19.048082808795396]}},{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-98.20215225219725,19.054978803148376]}},{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-98.21605682373047,19.061793386528766]}},{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-98.22275161743164,19.05359962720829]}},{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-98.23159217834473,19.0492997698019]}},{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-98.23433876037598,19.046703575532554]}},{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-98.21288108825684,19.03639952912028]}},{\"type\":\"Feature\",\"properties\":{\"stroke\":\"#00fcff\",\"stroke-width\":2,\"stroke-opacity\":1,\"fill\":\"#00fcff\",\"fill-opacity\":0.5},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[-98.23416709899902,19.04662244380717],[-98.21296691894531,19.03672407576917],[-98.20635795593262,19.048407332603105],[-98.20206642150879,19.055141058387473],[-98.21648597717285,19.062523503853996],[-98.22223663330077,19.053761883796376],[-98.23142051696776,19.0492997698019],[-98.23416709899902,19.04662244380717]]]}}]})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Escribir con Latex dentro de Jupyter Notebook\n", "\n", "O más bien escribir equaciones empleando la notación de Latex. Esto es muy útil para data science, pues porque matemáticas, puedes ver un ejemplo en el artículo de [Arkham](https://nbviewer.jupyter.org/github/Darkade/notebooks/blob/master/Arkham%20Horror%20The%20Card%20Game.ipynb).\n", "\n", "$$\n", "\\int_y^x f(t) dt = x f(x) - y f(y) - \\int_y^x t f'(t) dt\n", "$$" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Presentaciones con Jupyter\n", "\n", "Puedes hasta hacer tus presentaciones con Jupyter y si se trata de código hacerlas con Jupyter tiene mucho sentido. De hecho, esta libreta también es una presentación y la puedes ver en modo de presentación [aquí](https://nbviewer.jupyter.org/format/slides/github/Darkade/notebooks/blob/master/Cosas%20que%20hacer%20con%20jupyter.ipynb).\n", "\n", "Considera las ventajas de hacer las cosas solo una vez y tener inmediatamente una presentación de tu trabajo. Sobre todo si estas haciendo data science, dónde la parte gráfica es muy importante, hacer esto es un ahorro impresionante de tiempo y energía." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Compartir tus libretas en linea con NBViwer & GitHub" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Esta parte es de mis favoritas, de hecho es algo que he utilizado en varios trabajos para compartir información. Al subir tu libreta a Github será _rendereada_ automáticamente, como [aquí](https://github.com/Darkade/notebooks/blob/master/Cosas%20que%20hacer%20con%20jupyter.ipynb) y puedes poner ese link en nbviwer que es una interfáz más limpia y te permite ver las libretas en modo de presentación, como [aquí.](https://nbviewer.jupyter.org/github/Darkade/notebooks/blob/master/Cosas%20que%20hacer%20con%20jupyter.ipynb)\n", "\n", "Para que algunas cosas específicas se vean correctamente en linea, por ejemplo los mapas, seguramente necesitas agregar algunas lineas de _Javascript._ Pero no es nada complicado, en ese caso te recomiendo utilizar nbviewer porque github no siempre te va a permitir _renderear_ algunos de esos elementos." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### ¡Y utilizar otros lenguajes!\n", "\n", "Jupyter no solo soporta Python. Si estas intersado en data science posiblemente quieras utilizar R y lo puedes hacer con Jupyter. Pero también puedes utilizar Julia, Scala, Haskell, Ruby, Bash.... y [muchos otros](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "El [artículo de Arkham]() también lo hice inicialmente utilizando Jupyter y estas son ejemplos delibretas [utilizando Ruby](https://nbviewer.jupyter.org/github/SciRuby/sciruby-notebooks/blob/master/getting_started.ipynb) y [Julia](https://nbviewer.jupyter.org/url/jdj.mit.edu/~stevenj/IJulia%20Preview.ipynb).\n", "\n", "Espero que esta introducción a Jupyter te sea útil. Y como siempre puedes dejar tus comentarios." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }