{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Titanic Examples" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook contains examples that show how to visualize the Titanic data set using Altair." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import seaborn.apionly as sns\n", "import altair.api as alt\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
\n", " | survived | \n", "pclass | \n", "sex | \n", "age | \n", "sibsp | \n", "parch | \n", "fare | \n", "embarked | \n", "class | \n", "who | \n", "adult_male | \n", "deck | \n", "embark_town | \n", "alive | \n", "alone | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | \n", "1 | \n", "1 | \n", "female | \n", "38 | \n", "1 | \n", "0 | \n", "71.2833 | \n", "C | \n", "First | \n", "woman | \n", "False | \n", "C | \n", "Cherbourg | \n", "yes | \n", "False | \n", "
3 | \n", "1 | \n", "1 | \n", "female | \n", "35 | \n", "1 | \n", "0 | \n", "53.1000 | \n", "S | \n", "First | \n", "woman | \n", "False | \n", "C | \n", "Southampton | \n", "yes | \n", "False | \n", "
6 | \n", "0 | \n", "1 | \n", "male | \n", "54 | \n", "0 | \n", "0 | \n", "51.8625 | \n", "S | \n", "First | \n", "man | \n", "True | \n", "E | \n", "Southampton | \n", "no | \n", "True | \n", "
10 | \n", "1 | \n", "3 | \n", "female | \n", "4 | \n", "1 | \n", "1 | \n", "16.7000 | \n", "S | \n", "Third | \n", "child | \n", "False | \n", "G | \n", "Southampton | \n", "yes | \n", "False | \n", "
11 | \n", "1 | \n", "1 | \n", "female | \n", "58 | \n", "0 | \n", "0 | \n", "26.5500 | \n", "S | \n", "First | \n", "woman | \n", "False | \n", "C | \n", "Southampton | \n", "yes | \n", "True | \n", "