Skip to content

Instantly share code, notes, and snippets.

@alexpearce
Last active January 30, 2017 16:54
Show Gist options
  • Save alexpearce/a18fcdb8a13093cac4468b9f341cffa2 to your computer and use it in GitHub Desktop.
Save alexpearce/a18fcdb8a13093cac4468b9f341cffa2 to your computer and use it in GitHub Desktop.
Lil' notebook.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Data manipulation with numpy and pandas\n",
"\n",
"A notebook for some of the code shown during Alex's presentation at [the DIANA meeting](http://indico.cern.ch/event/596268/)."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"RangeIndex(start=0, stop=96, step=1)"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Generation\n",
"data = np.random.normal(loc=20, scale=10, size=100) # Selections\n",
"selection_mask = data > 0\n",
"# Pandas\n",
"df = pd.DataFrame(dict(pion_pt=data[selection_mask]))\n",
"df.index"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"(21.070209199862475, 9.2392323518739872)"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.pion_pt.mean(), df.pion_pt.std()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>pion_pt</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0.01</th>\n",
" <td>5.416159</td>\n",
" </tr>\n",
" <tr>\n",
" <th>0.99</th>\n",
" <td>42.073820</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" pion_pt\n",
"0.01 5.416159\n",
"0.99 42.073820"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.quantile([0.01, 0.99])"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"0 (5, 15]\n",
"1 (15, 100]\n",
"2 (5, 15]\n",
"3 (15, 100]\n",
"4 (15, 100]\n",
"5 (5, 15]\n",
"6 (15, 100]\n",
"7 (15, 100]\n",
"8 (15, 100]\n",
"9 (15, 100]\n",
"10 (15, 100]\n",
"11 (5, 15]\n",
"12 (15, 100]\n",
"13 (15, 100]\n",
"14 (5, 15]\n",
"15 (5, 15]\n",
"16 (15, 100]\n",
"17 (15, 100]\n",
"18 (15, 100]\n",
"19 (5, 15]\n",
"20 (5, 15]\n",
"21 (15, 100]\n",
"22 (5, 15]\n",
"23 (15, 100]\n",
"24 (5, 15]\n",
"25 (15, 100]\n",
"26 (5, 15]\n",
"27 (5, 15]\n",
"28 (15, 100]\n",
"29 (5, 15]\n",
" ... \n",
"66 (15, 100]\n",
"67 (15, 100]\n",
"68 (15, 100]\n",
"69 (15, 100]\n",
"70 (15, 100]\n",
"71 (5, 15]\n",
"72 (5, 15]\n",
"73 (15, 100]\n",
"74 (15, 100]\n",
"75 (15, 100]\n",
"76 (15, 100]\n",
"77 (15, 100]\n",
"78 (5, 15]\n",
"79 (5, 15]\n",
"80 (15, 100]\n",
"81 (15, 100]\n",
"82 (15, 100]\n",
"83 (5, 15]\n",
"84 (5, 15]\n",
"85 (15, 100]\n",
"86 (15, 100]\n",
"87 (15, 100]\n",
"88 (15, 100]\n",
"89 (15, 100]\n",
"90 (5, 15]\n",
"91 (15, 100]\n",
"92 (15, 100]\n",
"93 (5, 15]\n",
"94 (5, 15]\n",
"95 (15, 100]\n",
"Name: pion_pt, dtype: category\n",
"Categories (3, object): [(0, 5] < (5, 15] < (15, 100]]"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = df.assign(kaon_pt=2*df.pion_pt)\n",
"cut = pd.cut(df.pion_pt, [0, 5, 15, 100])\n",
"cut"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"%matplotlib inline"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"pion_pt\n",
"(0, 5] 7.237355\n",
"(5, 15] 20.844622\n",
"(15, 100] 51.109383\n",
"Name: kaon_pt, dtype: float64"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mean_kaon_pt = df.kaon_pt.groupby(cut).mean()\n",
"mean_kaon_pt"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYcAAAELCAYAAAAybErdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8FHXi//HXJz2hBEIghAQIvZeEiCg2bFhQiooV9VSi\nZzlP7zz1vn7PK3pfr3reffVO1LsTbCgEsHewHmqyoXeQkk1CCBASSup+fn9k9JcvCbApm0my7+fj\nkQc7s7Mzb3Qyb2Zn57PGWouIiEhtIW4HEBGR1kflICIidagcRESkDpWDiIjUoXIQEZE6VA4iIlKH\nykFEROpQOYiISB0qBxERqSOsJTcWHx9vU1JSWnKTIiJtXnZ2dpG1tntLbrNFyyElJYWsrKyW3KSI\nSJtnjNnR0tvU20oiIlKHykFEROpQOYiISB0qBxERqUPlICIidagcRESkDpWDiIjU0aL3OYiIiP+q\nfZZnP9vmyrZVDiIirVBJWSV3v5zD0o17XNm+3lYSEWlltu45yLQnv+CzzUU8Mm2kKxn8On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2ItCkqB2kv+hhj\nTnEeXwN8Xuu5r4EzjTHxzrAGVwOfNHI7VxhjQpzvc+gPbKTm27k6NXJ9Iq2SykHai43AHcaY9UBX\nar5ICqgZO5+aESmXAiuBbGttY79OdCc1ZfMOcJu1tsxZ73BdkJb2RB9llTavpUbw1eirEkx05iAi\nInXozEHkKMaY/6LmC39qe81a+6gbeUTcoHIQEZE69LaSiIjUoXIQEZE6VA4iIlKHykFEROpQOYiI\nSB3/D3V5wwbNZx/8AAAAAElFTkSuQmCC\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x1108ec8d0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mean_kaon_pt.plot()\n",
"plt.savefig('pandas_plotting1.pdf')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEKCAYAAAD6q1UVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEV5JREFUeJzt3X2MpWV9xvHv5S6UF62CjFTBdflDMZZWtBsr0hgLvmDX\ngG20QkNFY7JJWxXti11SG9JGkyUxrfxhmm4QJWrXxC1EIxYhKhpTpS4vKrCCigvuKuwaRASJgPz6\nx5wlw7JndnbOc85zztzfT7KZmecc5r6yPPc19z7znPukqpAkteUpfQeQJE2e5S9JDbL8JalBlr8k\nNcjyl6QGWf6S1CDLX5IaZPlPmSRHJ7kiyYNJ7kzyF31nkvqQ5J1JtiX5dZKP951npVnddwA9yUeA\nh4FjgZOBK5N8u6pu6TeWNHE/AT4AvA44vOcsK058he/0SHIk8HPgpKq6fXDsE8CuqtrYazipJ0k+\nABxfVW/rO8tK4mWf6fIC4NG9xT/wbeB3e8ojaYWy/KfLU4H79zn2C+BpPWSRtIJZ/tPlAeC39zn2\n28Ave8giaQWz/KfL7cDqJM9fcOzFgL/sldQpy3+KVNWDwOXAvyY5MsmpwFnAJ/pNJk1ektV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y5xZMeXP/En/Op78\n2/EA/zuB8e9JcnJV3QQwWPm8AbgU+L0JjA/wcJIjqupXwB/sPTi4L3wiJ3hVPQb8e5LPDD7ew8o6\nz6ZB3+f6YqZhHuxP73NjmL7mzEqalJ8Hnrr3pFsoybUTGP+twKMLD1TVo8Bbk/znBMYHeGVV/Xow\n9sIT+hDm7wGfmKraCbw5yXrg/kmO3YC+z/XFTMM82J+pmRvDTHrONHHNX5L0RCvpPn9J0hJZ/pLU\nIMtfkhpk+UtSgyx/SWrQ/wOhUSGMdrkirgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x110961d50>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df = df.assign(is_background=np.random.choice([0, 1], size=len(df)))\n",
"df.pion_pt.hist(by=df.is_background)\n",
"plt.savefig('pandas_plotting2.pdf')"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>kaon_pt</th>\n",
" <th>is_background</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>28.569002</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>60.393369</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>25.833684</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>54.030633</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>52.372494</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>13.068480</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>78.056473</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>44.801066</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>52.639216</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>73.019071</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>83.835997</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>17.193063</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <td>36.448640</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>49.592644</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>14</th>\n",
" <td>18.357084</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>15</th>\n",
" <td>27.076739</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>16</th>\n",
" <td>62.834707</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>17</th>\n",
" <td>51.965297</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18</th>\n",
" <td>46.662708</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>19</th>\n",
" <td>24.140616</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20</th>\n",
" <td>24.643522</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>21</th>\n",
" <td>56.386886</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>22</th>\n",
" <td>25.591236</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>23</th>\n",
" <td>46.406459</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>24</th>\n",
" <td>19.372286</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25</th>\n",
" <td>49.864541</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>26</th>\n",
" <td>20.639196</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>27</th>\n",
" <td>17.653133</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>28</th>\n",
" <td>35.124794</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>29</th>\n",
" <td>25.292786</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>66</th>\n",
" <td>30.758337</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>67</th>\n",
" <td>52.981138</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>68</th>\n",
" <td>34.790661</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>69</th>\n",
" <td>42.753563</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>70</th>\n",
" <td>38.518155</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>71</th>\n",
" <td>22.994884</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>72</th>\n",
" <td>18.034684</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>73</th>\n",
" <td>38.380549</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>74</th>\n",
" <td>82.611995</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75</th>\n",
" <td>41.747976</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>76</th>\n",
" <td>41.848248</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>77</th>\n",
" <td>71.975208</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>78</th>\n",
" <td>19.063019</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>79</th>\n",
" <td>13.310450</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>80</th>\n",
" <td>32.552022</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>81</th>\n",
" <td>54.656309</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>82</th>\n",
" <td>44.540749</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>83</th>\n",
" <td>18.574873</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>84</th>\n",
" <td>29.552915</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>85</th>\n",
" <td>40.152165</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>86</th>\n",
" <td>58.546651</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>87</th>\n",
" <td>59.585978</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>88</th>\n",
" <td>35.320041</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>89</th>\n",
" <td>54.985714</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>90</th>\n",
" <td>28.144450</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>91</th>\n",
" <td>62.766003</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>92</th>\n",
" <td>53.433779</td>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>93</th>\n",
" <td>11.021526</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>94</th>\n",
" <td>14.928735</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>95</th>\n",
" <td>39.465356</td>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>96 rows × 2 columns</p>\n",
"</div>"
],
"text/plain": [
" kaon_pt is_background\n",
"0 28.569002 0\n",
"1 60.393369 1\n",
"2 25.833684 1\n",
"3 54.030633 1\n",
"4 52.372494 1\n",
"5 13.068480 1\n",
"6 78.056473 1\n",
"7 44.801066 1\n",
"8 52.639216 0\n",
"9 73.019071 0\n",
"10 83.835997 1\n",
"11 17.193063 0\n",
"12 36.448640 0\n",
"13 49.592644 0\n",
"14 18.357084 1\n",
"15 27.076739 1\n",
"16 62.834707 0\n",
"17 51.965297 1\n",
"18 46.662708 0\n",
"19 24.140616 1\n",
"20 24.643522 0\n",
"21 56.386886 0\n",
"22 25.591236 1\n",
"23 46.406459 0\n",
"24 19.372286 0\n",
"25 49.864541 0\n",
"26 20.639196 0\n",
"27 17.653133 0\n",
"28 35.124794 0\n",
"29 25.292786 0\n",
".. ... ...\n",
"66 30.758337 0\n",
"67 52.981138 0\n",
"68 34.790661 1\n",
"69 42.753563 0\n",
"70 38.518155 0\n",
"71 22.994884 0\n",
"72 18.034684 1\n",
"73 38.380549 1\n",
"74 82.611995 1\n",
"75 41.747976 1\n",
"76 41.848248 0\n",
"77 71.975208 1\n",
"78 19.063019 1\n",
"79 13.310450 1\n",
"80 32.552022 0\n",
"81 54.656309 0\n",
"82 44.540749 1\n",
"83 18.574873 1\n",
"84 29.552915 0\n",
"85 40.152165 0\n",
"86 58.546651 0\n",
"87 59.585978 1\n",
"88 35.320041 1\n",
"89 54.985714 1\n",
"90 28.144450 1\n",
"91 62.766003 1\n",
"92 53.433779 1\n",
"93 11.021526 0\n",
"94 14.928735 0\n",
"95 39.465356 1\n",
"\n",
"[96 rows x 2 columns]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[df.columns[1:]]"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0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BPPocCdwMnA\nz4FBXd5vJdvYaVI6vwr4NHAg8ACwHbA9sIRsP4QPAN+tuH6HiuPnu8bfWZ5+dnfPVrKl0iekejcA\nH875LF3/bTqv25fsj8IFKX6RbWb079XU6fI7ngB2Lvu/I7+KfbkFYWWp7Gbq7F6aTPbl+LvUfz4Z\n2D3VeTIi7unhfj1d+xXgSKAN+L95F0fEXWRfhucBJ0bEhpxqyyPiV+n4h8C70mt2RPw5Ip4Hfgr8\nNdkX/JGSvirpryNiXQ+xd9XdPQEej4jOsYUFZF/s1Xg8Ih6IiFfJEs4dEREpztY+1LEm4v0grCw3\nAbMkHQAMi2zjlUOAqyPiNftVpy6oP/dyP+Vdm7SQ/SU+mGzt/tfdK+3RMQpYE9m2mXm6rmzZ7UqX\nEfFw+mzHABdIuiMivtLLZ6jGyxXHG4Beu5hyrnu14vxVNn0PVFPHmohbEFaK9JfxPLJujM7B6TuA\nD0raBUDSTpJ26+YWz5EtH96pp2u/A3yBbBe7r3a9kaRR6b0pwPNp74o84yS9Mx3/A/BL4L+B4yUN\nk7Qd8D6ysZQ3AS9ExA+BrwEH9BJ/pdx7dlPXrDD+q8DK9CNgNqmrKSKWSvo8cFuaqbQeOBN43S57\nEbEmDaAuBm6JiM/kXSvpb4D1EXGdpEHAryUdERG/AEgDzT8FPhURD0r6V7IkcmtOvL9P97wKWApc\nEREvSPo+8NtU53sRca+yabxfk/RqiuWfe4u/4r2F3dyztdp/WLP+4P0gzKqQvpx/FhGvmwFVawYi\nVjXBLojmLiazRrQB2EEFPihHNp7zan/f32qLWxBmZpbLLQgzM8vlBGFmZrmcIMzMLJcThJmZ5XKC\nMDOzXE4QZmaWywnCzMxyOUGYmVmu/wWIzfQadPuudwAAAABJRU5ErkJggg==\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x11325e390>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"data1 = np.random.normal(loc=1, size=10000)\n",
"data2 = np.random.normal(loc=-1, size=10000)\n",
"fig = plt.figure()\n",
"ax = fig.add_subplot(1, 1, 1)\n",
"plot_kwargs = dict(bins=100, range=(-5, 5), alpha=0.5)\n",
"ax.hist(data1, label='Data $x$', **plot_kwargs)\n",
"ax.hist(data2, label='Data $y$', **plot_kwargs)\n",
"ax.set_xlabel('Vertex $x$ position [mm]')\n",
"ax.set_ylabel('Candidates')\n",
"ax.legend()\n",
"fig.savefig('histograms.pdf');"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment