json 绘制泰坦尼克数据:由Begüm领导的Schloss实验室代码审查任务
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了json 绘制泰坦尼克数据:由Begüm领导的Schloss实验室代码审查任务相关的知识,希望对你有一定的参考价值。
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Plotting the Titanic Data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Get the data"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Survived</th>\n",
" <th>Pclass</th>\n",
" <th>Name</th>\n",
" <th>Sex</th>\n",
" <th>Age</th>\n",
" <th>Siblings/Spouses Aboard</th>\n",
" <th>Parents/Children Aboard</th>\n",
" <th>Fare</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>Mr. Owen Harris Braund</td>\n",
" <td>male</td>\n",
" <td>22.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>7.2500</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>Mrs. John Bradley (Florence Briggs Thayer) Cum...</td>\n",
" <td>female</td>\n",
" <td>38.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>71.2833</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>Miss. Laina Heikkinen</td>\n",
" <td>female</td>\n",
" <td>26.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>7.9250</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>Mrs. Jacques Heath (Lily May Peel) Futrelle</td>\n",
" <td>female</td>\n",
" <td>35.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>53.1000</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>Mr. William Henry Allen</td>\n",
" <td>male</td>\n",
" <td>35.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>8.0500</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Survived Pclass Name \\\n",
"0 0 3 Mr. Owen Harris Braund \n",
"1 1 1 Mrs. John Bradley (Florence Briggs Thayer) Cum... \n",
"2 1 3 Miss. Laina Heikkinen \n",
"3 1 1 Mrs. Jacques Heath (Lily May Peel) Futrelle \n",
"4 0 3 Mr. William Henry Allen \n",
"\n",
" Sex Age Siblings/Spouses Aboard Parents/Children Aboard Fare \n",
"0 male 22.0 1 0 7.2500 \n",
"1 female 38.0 1 0 71.2833 \n",
"2 female 26.0 0 0 7.9250 \n",
"3 female 35.0 1 0 53.1000 \n",
"4 male 35.0 0 0 8.0500 "
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"import seaborn as sns\n",
"import matplotlib.pyplot as plt\n",
"%matplotlib inline\n",
"\n",
"titanic_data = pd.read_csv('titanic.csv')\n",
"titanic_data.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Calculate family size"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Survived</th>\n",
" <th>Pclass</th>\n",
" <th>Name</th>\n",
" <th>Sex</th>\n",
" <th>Age</th>\n",
" <th>Siblings/Spouses Aboard</th>\n",
" <th>Parents/Children Aboard</th>\n",
" <th>Fare</th>\n",
" <th>family_size</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>Mr. Owen Harris Braund</td>\n",
" <td>male</td>\n",
" <td>22.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>7.2500</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>Mrs. John Bradley (Florence Briggs Thayer) Cum...</td>\n",
" <td>female</td>\n",
" <td>38.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>71.2833</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>Miss. Laina Heikkinen</td>\n",
" <td>female</td>\n",
" <td>26.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>7.9250</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>Mrs. Jacques Heath (Lily May Peel) Futrelle</td>\n",
" <td>female</td>\n",
" <td>35.0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>53.1000</td>\n",
" <td>2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>Mr. William Henry Allen</td>\n",
" <td>male</td>\n",
" <td>35.0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>8.0500</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Survived Pclass Name \\\n",
"0 0 3 Mr. Owen Harris Braund \n",
"1 1 1 Mrs. John Bradley (Florence Briggs Thayer) Cum... \n",
"2 1 3 Miss. Laina Heikkinen \n",
"3 1 1 Mrs. Jacques Heath (Lily May Peel) Futrelle \n",
"4 0 3 Mr. William Henry Allen \n",
"\n",
" Sex Age Siblings/Spouses Aboard Parents/Children Aboard Fare \\\n",
"0 male 22.0 1 0 7.2500 \n",
"1 female 38.0 1 0 71.2833 \n",
"2 female 26.0 0 0 7.9250 \n",
"3 female 35.0 1 0 53.1000 \n",
"4 male 35.0 0 0 8.0500 \n",
"\n",
" family_size \n",
"0 2 \n",
"1 2 \n",
"2 1 \n",
"3 2 \n",
"4 1 "
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"family_sizes = list()\n",
"for index, row in titanic_data.iterrows():\n",
" family_sizes.append(row['Siblings/Spouses Aboard'] + row['Parents/Children Aboard'] + 1)\n",
"titanic_data['family_size'] = family_sizes\n",
"titanic_data.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Make pretty plots"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAEoZJREFUeJzt3X+QXWd93/H3xxIKg3FCgretx5KRCgKiEojrRZQ2JaaYRJ52pDT8iBx3gqc0GqYIt2VIa0qqUhPKFDrQ0IgEJXVDmIAA0yRLRq0afg4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qpLcA2ymd+X4u5JspbesyGOG7ONHgJ0Dc7aPBa6i949SOhtLvZcAPlZVDwAPJPkG8KF+/z30PtQAPCPJzwFPAB5P79qnJsnjgb8NfGBgPc3v6uIXuRgYCmvTgwOPvzPQ/g69v/M30PvH+A/797D4+JB9BHhRVbnOlM7X0PdSkucw+r0K8KvAj1XV55LcBFy7aP+XAF+vqh9c2bIvTk4fXZy+B/hS//FNS4w5DLzqzFLmSa5ehbq0Np3ve+ky4MtJHgPcuHhjVX0TOJHkJf39J8mzzrPmi5ahcHF6M/CmJHfQW4JkmDfQm1a6O8nn+23pXJzve+nfAJ8Bfofe+bBhbgRenuRzwFEeee8WjckrmiVJjUcKkqTGUJAkNYaCJKkxFCRJjaEgSWoMBeks9NfxOZrk7iR39S/AktYMr2iWxpTkucA/AP5mVT2Y5HJgw4TLklaURwrS+K4A7q+qBwGq6v6qOpXkmiSf6K/QeTjJFUnW91f2vBYgyZuSvHGSxUvj8OI1aUz9hdd+F3gc8GHgfcCngE8Au6pqIclPAD9aVf84yd8AbgdupncV+XOq6qHJVC+Nx+kjaUxV9a0k1wB/l94S0O8Dfo7e8s+/01/aZx3w5f74o0neTW/lz+caCLoQGArSWaiqh+mtKvvx/lLkrwSOVtVzl3jKDwBfB/7q6lQonR/PKUhjSvK0/j0ozvhBeveXmOqfhCbJY/rTRiT5ceCJwPOAtyd5wmrXLJ0tzylIY+pPHf1nejd7OQ3MAXuAjcDb6S1Jvh74T8Bv0Dvf8IKqOpnkZuCaqnrZJGqXxmUoSJIap48kSY2hIElqDAVJUmMoSJIaQ0GS1BgKkqTGUJAkNYaCJKn5/8gWz+fOd2/GAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.barplot(x='Sex', y='Survived', data=titanic_data, ci=None)\n",
"plt.savefig('sex_survival.svg', format='svg')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEKCAYAAAD9xUlFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAFsBJREFUeJzt3X2QVfWd5/H3F1AYRtRS3CwKCjuiIKISUROdmqDGYLKrbGXyQNZkdE1C+YjWqFkNPjAkZmoT1qlo1AyWWZTyYX0Oa5EYY0CMIk/yLCEiEumRRCSBACOhm3z3j3s922ma7gv06Qv4flV1ec65v3vu93DL/vTvd875nchMJEkC6FLvAiRJew9DQZJUMBQkSQVDQZJUMBQkSQVDQZJUMBQkSQVDQZJUMBQkSYVuZe04In4E/Bfg3cw8sZXXA/g+8Bng34FLMvO19vbbu3fv7N+/fwdXK0n7t/nz57+XmUe01660UAAmAz8AHtzJ658GBlZ/zgDurf63Tf3792fevHkdVKIkfThExG9qaVfa8FFmzgR+30aTUcCDWfEqcGhE9CmrHklS++p5TuEoYE2z9YbqNklSndQzFKKVba1O2RoRYyJiXkTMW7duXcllSdKHV5nnFNrTAPRrtt4XeKe1hpk5CZgEMHz4cOf6lkRjYyMNDQ1s3bq13qXsVXr06EHfvn054IADduv99QyFqcBVEfEolRPMGzNzbR3rkbQPaWhooFevXvTv35/KxYzKTNavX09DQwMDBgzYrX2UeUnqI8AIoHdENAC3AQcAZOYPgWlULkddSeWS1P9eVi2S9j9bt241EFqICA4//HD2ZJi9tFDIzC+183oCV5b1+ZL2fwbCjvb038Q7miVJBUNBkmpw++23M2TIEE466SROOeUUZs+eXe+SSlHPE81qxdsThta7hF129K1L6l2CVKpZs2bx7LPP8tprr9G9e3fee+89tm3bVu+ySmFPQZLasXbtWnr37k337t0B6N27N0ceeSTz58/nE5/4BKeeeiojR45k7dq1NDU1cdpppzFjxgwAbrrpJsaNG1fH6neN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zoYg4EOiame/X5YClZuwpSDv6q+o0yvOAt6nMa3QO8ERmvgeQma09++LEiHipGgIXAUOq218GJkfE14Gu1W2zgG9GxP8AjjEQtLfoVu8CpL3Q+9VplAvVSe/a61ZPpvLEtUURcQkwAiAzL4uIM4D/DCyMiFMy8+GImF3d9lxEfC0zf9HBxyHtMnsKUm1eAL4QEYcDRMRhrbTpBaytTqN90QcbI+JvMnN2Zt4KvAf0i4j/BKzKzDuBqcBJpR+BVAN7ClINMnNZRNwOvBgR24EFwCUtmt1C5YlrvwGWUAkJgO9VTyQHlXBZBNwIfDkiGoHfAhNKPwipBp5oliQVHD6SJBUMBUlSwVCQJBUMBUlSwVCQJBUMBUlSwVCQJBUMBUlS4f8BVte7KpfDpRcAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.barplot(x='Pclass', y='Survived', data=titanic_data, hue='Sex', ci=None)\n",
"plt.savefig('class_survival.svg', format='svg')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAELCAYAAAA2mZrgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4xLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvDW2N/gAAGS9JREFUeJzt3X+01XWd7/Hn2yOFJeUN8OZ4NOiOGcaPo55AL0olOqG3hSvB0izjxgyre/PHjI3d5jaLlbh0KvtljeWgGWlevVRTi5SkGqTmMmpAgoJkIv7g+GNETMMUBXzfP/bmO8fDgb2R/eV7ODwfa53l/u79OXu/Dsp5+f18v9/PNzITSZIA9qs6gCSp77AUJEkFS0GSVLAUJEkFS0GSVLAUJEkFS0GSVLAUJEkFS0GSVNi/6gC7asiQITls2LCqY0jS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VdxTUL8WEVdTWzF0XkT8r4j4t/qqof+2bQmIiJgWET+JiJ9GxEMRcV5EXFQfd2dEvKU+bk5ETO3x/tMj4mvdtv8qInpdqqS+HMat9ZsWrYyID9efXxQRnRExudsV7fdHxEP114+NiF/VV2BdEBGHlPOnJVkK6ucy85PU1sZ/H/BtYEJ91dCZvHrZh5HAR6gtZHcZ8EJ93B3AuTv5iJupLdA3oL7934Hv7mDsJODxzBxTv5nLq5bCyMx53W5AswL4cv19vwlMzcxjgevq+aRS7F91AGkPejPwvYg4gtr9DwZ0e+32+g2ONkbEc8BP68/fC4ze0Rtm5p8iYiHwgYhYDQzIzHt3MPxear/ovwjckpn/2tugiPgM8GJmXlVfqnwk8IvaWm20UVvzXyqFpaB9yaXUfvl/sH4zo0XdXnup2+NXum2/QuO/J9cC/5vaCrI72ksgM38fEccCpwH/EBE/z8xZ3cdExETgTGp3TQMIYFVmVn5/Ze0bLAXtS94MPFZ/PK1Vb5qZd0XEYdTuV7DDvYqI+DPgmcz8fkQ83zNDRLwN+BYwKTNfrD99PzA0Io7PzDvq00nvyMxVrcovdWcpaF/yJWrTRxcBC1v83nOBjsz8w07GjAKuiIhXgM3A/+jx+jRgMPDj+lTR45l5Wv3g9jci4s3U/s5+HbAUVApPSZVaICJuAb6Wmf9SdRZpd3j2kbQbIuKgiPg9tQPDFoL2eu4pSC0WEYOB3gpiYmZu2NN5pF1hKUiSCk4fSZIKloIkqWApSJIKloIkqWApSJIK/x+t1zcvTCROVwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"sns.barplot(x='family_size', y='Survived', data=titanic_data, hue='Pclass', ci=None)\n",
"plt.savefig('family_size_survival.svg', format='svg')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEXCAYAAABCjVgAAAA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LKouZmaWT5TWFWcCI3bx/IbkJwY4HJpCbFsDMzEoos6IQEc8C7+6myaXAg5HzHNBNUs+s8piZWWGlvKbQC1jbZLsu2fdW84aSJpA7m6B3795tEm5fDLrpwVTtln716oyTfKg9ZkrrD1P7p2rXe/KLRTle2j+rn3T9asE27TETFC/XgaaxsZG6ujq2bNlS6iitqqiooKqqivLy8r36fCmLQkszRrY450ZEzABmAAwePNjzcphZSdTV1dG1a1f69OlDk6nO242IoL6+nrq6Ovr23bvlOEr5nEIdcHST7SrgzRJlMTMraMuWLXTv3r1dFgQASXTv3n2fzmRKeaYwF7hO0iNADfBeROwydFRIRx4WMbOOp70WhJ32NV9mRUHSHOBcoFJSHfC/gXKAiJgO/Ay4iNyUwX8BPptVFjMzSyezohARVxZ4P4DPZ3V8M7O2UlZWRv/+/dm2bRv9+vXjgQceoHPnzi22ve222+jSpQs33nhjG6dMx3MfmZnto0MPPZTly5dTW1vLwQcfzPTp00sdaa91uGkuLFttffun2f7m7LPPZsWKFQA8+OCDfO1rX0MSAwYMYPbs2R9pO3PmTGbMmMHWrVs57rjjmD17Np07d+axxx5jypQplJWVcfjhh/Pss8+ycuVKPvvZz7J161Z27NjB448/zvHHH1/0/C4KZmZFsm3bNp566ilGjBjBypUrmTZtGosWLaKyspJ33931Wd6RI0dyzTXXAHDrrbdy3333cf311zN16lSefvppevXqxcaNGwGYPn06kyZNYsyYMWzdupXt27dn8jscMEXB/wI2s6xs3ryZ6upqIHemMH78eO655x5Gjx5NZWUlAEccccQun6utreXWW29l48aNbNq0iQsuuACAM888k3HjxnH55ZczcuRIAM444wymTZtGXV0dI0eOzOQsAQ6gotAeuVCZ7R92XlNoKiIK3h46btw4nnjiCQYOHMisWbNYuHAhkDsrWLx4MfPmzaO6uprly5dz1VVXUVNTw7x587jgggu49957Oe+884r+u/hCs5lZBoYNG8ajjz5KfX09QIvDRw0NDfTs2ZPGxkYefvjh/P7Vq1dTU1PD1KlTqaysZO3atbz22msce+yxTJw4kUsuuS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SalYEkp4EvhkRvyh1FrN94buPzPaBpG6Sfk/uwrALgnV4PlMwKzJJ3YGWCsSwiKhv6zxme8JFwczM8jx8ZGZmeS4KZmaW56JgZmZ5LgpmZpb3/wH2idUanXcoBwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 2 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(ncols=1, nrows=2, sharex=True)\n",
"for sex, axis in (('male', 1), ('female', 0)):\n",
" sns.barplot(x='family_size', y='Survived', data=titanic_data.loc[titanic_data['Sex'] == sex], hue='Pclass', ax=ax[axis], ci=None)\n",
" ax[axis].set(title=sex)\n",
" if sex == 'female':\n",
" ax[axis].set(xlabel='')\n",
"plt.savefig('family_size_sex_survival.svg', format='svg')"
]
}
],
"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.6.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
以上是关于json 绘制泰坦尼克数据:由Begüm领导的Schloss实验室代码审查任务的主要内容,如果未能解决你的问题,请参考以下文章