Skip to content

Instantly share code, notes, and snippets.

@bkamins
Last active November 21, 2020 18:44
Show Gist options
  • Save bkamins/c6b7b536aefda6c2be67f133972a62e8 to your computer and use it in GitHub Desktop.
Save bkamins/c6b7b536aefda6c2be67f133972a62e8 to your computer and use it in GitHub Desktop.
Showcasing DataFrames.jl version 0.22
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Working with DataFrames.jl v0.22.1\n",
"\n",
"# Part 1\n",
"\n",
"## Bogumił Kamiński"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this part of the tutorial we will use the *airports2.csv* file that is available for download here: https://www.kaggle.com/flashgordon/usa-airport-dataset. Therefore before starting it please be sure to download it and and have it un-zipped in your working directory.\n",
"\n",
"Our objective is to show selected features of v0.22.1 release of the DataFrames.jl package.\n",
"\n",
"This tutorial is not meant to be a replacement of a documentation - it just shows some practical application examples. If you want to know all the details of the discussed functionalities please refer to docstrings of the functions we show."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As usual in Julia, for every project you should have *Project.toml* and *Manifest.toml* files that specify the dependencies. They are bundled with this file in a GitHub gist.\n",
"\n",
"If you do not have much experience with project dependencies and want to understand more about managing them I recommend you to read https://bkamins.github.io/julialang/2020/05/18/project-workflow.html.\n",
"\n",
"This tutorial was developed under Julia 1.5.3."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Before we start let us make sure that you have the right versions of packages installed.\n",
"\n",
"The output of the command below should be:\n",
"```\n",
" [6e4b80f9] BenchmarkTools v0.5.0\n",
" [336ed68f] CSV v0.8.0\n",
" [a93c6f00] DataFrames v0.22.1\n",
" [7073ff75] IJulia v1.23.0\n",
" [0f8b85d8] JSON3 v1.5.1\n",
" [b98c9c47] Pipe v1.3.0\n",
" [91a5bcdd] Plots v1.9.1\n",
" ```"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[32m\u001b[1mStatus\u001b[22m\u001b[39m `~/Downloads/c6b7b536aefda6c2be67f133972a62e8-10e8f32fdf4f6e15dea2d883ffd7311f11934e7e/Project.toml`\n",
" \u001b[90m [6e4b80f9] \u001b[39m\u001b[37mBenchmarkTools v0.5.0\u001b[39m\n",
" \u001b[90m [336ed68f] \u001b[39m\u001b[37mCSV v0.8.0\u001b[39m\n",
" \u001b[90m [a93c6f00] \u001b[39m\u001b[37mDataFrames v0.22.1\u001b[39m\n",
" \u001b[90m [7073ff75] \u001b[39m\u001b[37mIJulia v1.23.0\u001b[39m\n",
" \u001b[90m [0f8b85d8] \u001b[39m\u001b[37mJSON3 v1.5.1\u001b[39m\n",
" \u001b[90m [b98c9c47] \u001b[39m\u001b[37mPipe v1.3.0\u001b[39m\n",
" \u001b[90m [91a5bcdd] \u001b[39m\u001b[37mPlots v1.9.1\u001b[39m\n"
]
}
],
"source": [
"] status"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We start with loading the required packages and reading in the CSV file to a `DataFrame`:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"using BenchmarkTools\n",
"using CSV\n",
"using DataFrames\n",
"using Dates\n",
"using Pipe\n",
"using Plots"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Origin_airport</th><th>Destination_airport</th><th>Origin_city</th><th>Destination_city</th><th>Passengers</th></tr><tr><th></th><th>String</th><th>String</th><th>String</th><th>String</th><th>Int64</th></tr></thead><tbody><p>3,606,803 rows × 15 columns (omitted printing of 10 columns)</p><tr><th>1</th><td>MHK</td><td>AMW</td><td>Manhattan, KS</td><td>Ames, IA</td><td>21</td></tr><tr><th>2</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>41</td></tr><tr><th>3</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>88</td></tr><tr><th>4</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>11</td></tr><tr><th>5</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>0</td></tr><tr><th>6</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>11</td></tr><tr><th>7</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>2</td></tr><tr><th>8</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>7</td></tr><tr><th>9</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>7</td></tr><tr><th>10</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>8</td></tr><tr><th>11</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>453</td></tr><tr><th>12</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>784</td></tr><tr><th>13</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>749</td></tr><tr><th>14</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>11</td></tr><tr><th>15</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>349</td></tr><tr><th>16</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1376</td></tr><tr><th>17</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>444</td></tr><tr><th>18</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1949</td></tr><tr><th>19</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>381</td></tr><tr><th>20</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1559</td></tr><tr><th>21</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1852</td></tr><tr><th>22</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>483</td></tr><tr><th>23</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1965</td></tr><tr><th>24</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>494</td></tr><tr><th>25</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>459</td></tr><tr><th>26</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>553</td></tr><tr><th>27</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1887</td></tr><tr><th>28</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>773</td></tr><tr><th>29</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1800</td></tr><tr><th>30</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1173</td></tr><tr><th>&vellip;</th><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cccccc}\n",
"\t& Origin\\_airport & Destination\\_airport & Origin\\_city & Destination\\_city & Passengers & \\\\\n",
"\t\\hline\n",
"\t& String & String & String & String & Int64 & \\\\\n",
"\t\\hline\n",
"\t1 & MHK & AMW & Manhattan, KS & Ames, IA & 21 & $\\dots$ \\\\\n",
"\t2 & EUG & RDM & Eugene, OR & Bend, OR & 41 & $\\dots$ \\\\\n",
"\t3 & EUG & RDM & Eugene, OR & Bend, OR & 88 & $\\dots$ \\\\\n",
"\t4 & EUG & RDM & Eugene, OR & Bend, OR & 11 & $\\dots$ \\\\\n",
"\t5 & MFR & RDM & Medford, OR & Bend, OR & 0 & $\\dots$ \\\\\n",
"\t6 & MFR & RDM & Medford, OR & Bend, OR & 11 & $\\dots$ \\\\\n",
"\t7 & MFR & RDM & Medford, OR & Bend, OR & 2 & $\\dots$ \\\\\n",
"\t8 & MFR & RDM & Medford, OR & Bend, OR & 7 & $\\dots$ \\\\\n",
"\t9 & MFR & RDM & Medford, OR & Bend, OR & 7 & $\\dots$ \\\\\n",
"\t10 & SEA & RDM & Seattle, WA & Bend, OR & 8 & $\\dots$ \\\\\n",
"\t11 & SEA & RDM & Seattle, WA & Bend, OR & 453 & $\\dots$ \\\\\n",
"\t12 & SEA & RDM & Seattle, WA & Bend, OR & 784 & $\\dots$ \\\\\n",
"\t13 & SEA & RDM & Seattle, WA & Bend, OR & 749 & $\\dots$ \\\\\n",
"\t14 & SEA & RDM & Seattle, WA & Bend, OR & 11 & $\\dots$ \\\\\n",
"\t15 & PDX & RDM & Portland, OR & Bend, OR & 349 & $\\dots$ \\\\\n",
"\t16 & PDX & RDM & Portland, OR & Bend, OR & 1376 & $\\dots$ \\\\\n",
"\t17 & PDX & RDM & Portland, OR & Bend, OR & 444 & $\\dots$ \\\\\n",
"\t18 & PDX & RDM & Portland, OR & Bend, OR & 1949 & $\\dots$ \\\\\n",
"\t19 & PDX & RDM & Portland, OR & Bend, OR & 381 & $\\dots$ \\\\\n",
"\t20 & PDX & RDM & Portland, OR & Bend, OR & 1559 & $\\dots$ \\\\\n",
"\t21 & PDX & RDM & Portland, OR & Bend, OR & 1852 & $\\dots$ \\\\\n",
"\t22 & PDX & RDM & Portland, OR & Bend, OR & 483 & $\\dots$ \\\\\n",
"\t23 & PDX & RDM & Portland, OR & Bend, OR & 1965 & $\\dots$ \\\\\n",
"\t24 & PDX & RDM & Portland, OR & Bend, OR & 494 & $\\dots$ \\\\\n",
"\t25 & PDX & RDM & Portland, OR & Bend, OR & 459 & $\\dots$ \\\\\n",
"\t26 & PDX & RDM & Portland, OR & Bend, OR & 553 & $\\dots$ \\\\\n",
"\t27 & PDX & RDM & Portland, OR & Bend, OR & 1887 & $\\dots$ \\\\\n",
"\t28 & PDX & RDM & Portland, OR & Bend, OR & 773 & $\\dots$ \\\\\n",
"\t29 & PDX & RDM & Portland, OR & Bend, OR & 1800 & $\\dots$ \\\\\n",
"\t30 & PDX & RDM & Portland, OR & Bend, OR & 1173 & $\\dots$ \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m3606803×15 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m Origin_airport \u001b[0m\u001b[1m Destination_airport \u001b[0m\u001b[1m Origin_city \u001b[0m\u001b[1m Destinatio\u001b[0m ⋯\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m ⋯\n",
"─────────┼──────────────────────────────────────────────────────────────────────\n",
" 1 │ MHK AMW Manhattan, KS Ames, IA ⋯\n",
" 2 │ EUG RDM Eugene, OR Bend, OR\n",
" 3 │ EUG RDM Eugene, OR Bend, OR\n",
" 4 │ EUG RDM Eugene, OR Bend, OR\n",
" 5 │ MFR RDM Medford, OR Bend, OR ⋯\n",
" 6 │ MFR RDM Medford, OR Bend, OR\n",
" 7 │ MFR RDM Medford, OR Bend, OR\n",
" 8 │ MFR RDM Medford, OR Bend, OR\n",
" 9 │ MFR RDM Medford, OR Bend, OR ⋯\n",
" 10 │ SEA RDM Seattle, WA Bend, OR\n",
" 11 │ SEA RDM Seattle, WA Bend, OR\n",
" ⋮ │ ⋮ ⋮ ⋮ ⋱\n",
" 3606794 │ STL TBN St. Louis, MO Fort Leona\n",
" 3606795 │ STL TBN St. Louis, MO Fort Leona ⋯\n",
" 3606796 │ STL TBN St. Louis, MO Fort Leona\n",
" 3606797 │ STL TBN St. Louis, MO Fort Leona\n",
" 3606798 │ STL TBN St. Louis, MO Fort Leona\n",
" 3606799 │ STL TBN St. Louis, MO Fort Leona ⋯\n",
" 3606800 │ STL TBN St. Louis, MO Fort Leona\n",
" 3606801 │ STL TBN St. Louis, MO Fort Leona\n",
" 3606802 │ CGI TBN Cape Girardeau, MO Fort Leona\n",
" 3606803 │ FWA OH1 Fort Wayne, IN Washington ⋯\n",
"\u001b[31m 12 columns and 3606782 rows omitted\u001b[0m"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = CSV.File(\"Airports2.csv\") |> DataFrame"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Before we move on let us change the display settings to allow for printing wider outupt and reduce the numbe of lines printed."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"20"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ENV[\"LINES\"] = 20 # lines are counted in number of rows printed"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1000"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ENV[\"COLUMNS\"] = 1000 # columns are counted in characters"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"After these changes Jupyter Notebook shoud show us all columns of the data frame we have just loaded. Let us check it."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Origin_airport</th><th>Destination_airport</th><th>Origin_city</th><th>Destination_city</th><th>Passengers</th><th>Seats</th><th>Flights</th><th>Distance</th><th>Fly_date</th><th>Origin_population</th><th>Destination_population</th><th>Org_airport_lat</th><th>Org_airport_long</th><th>Dest_airport_lat</th><th>Dest_airport_long</th></tr><tr><th></th><th>String</th><th>String</th><th>String</th><th>String</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Date</th><th>Int64</th><th>Int64</th><th>String</th><th>String</th><th>String</th><th>String</th></tr></thead><tbody><p>3,606,803 rows × 15 columns</p><tr><th>1</th><td>MHK</td><td>AMW</td><td>Manhattan, KS</td><td>Ames, IA</td><td>21</td><td>30</td><td>1</td><td>254</td><td>2008-10-01</td><td>122049</td><td>86219</td><td>39.140998840332</td><td>-96.6707992553711</td><td>NA</td><td>NA</td></tr><tr><th>2</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>41</td><td>396</td><td>22</td><td>103</td><td>1990-11-01</td><td>284093</td><td>76034</td><td>44.1245994567871</td><td>-123.21199798584</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>3</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>88</td><td>342</td><td>19</td><td>103</td><td>1990-12-01</td><td>284093</td><td>76034</td><td>44.1245994567871</td><td>-123.21199798584</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>4</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>11</td><td>72</td><td>4</td><td>103</td><td>1990-10-01</td><td>284093</td><td>76034</td><td>44.1245994567871</td><td>-123.21199798584</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>5</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>0</td><td>18</td><td>1</td><td>156</td><td>1990-02-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>6</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>11</td><td>18</td><td>1</td><td>156</td><td>1990-03-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>7</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>2</td><td>72</td><td>4</td><td>156</td><td>1990-01-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>8</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>7</td><td>18</td><td>1</td><td>156</td><td>1990-09-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>9</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>7</td><td>36</td><td>2</td><td>156</td><td>1990-11-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>10</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>8</td><td>18</td><td>1</td><td>228</td><td>1990-02-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>11</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>453</td><td>3128</td><td>23</td><td>228</td><td>1990-01-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>12</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>784</td><td>2720</td><td>20</td><td>228</td><td>1990-02-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>13</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>749</td><td>2992</td><td>22</td><td>228</td><td>1990-03-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>14</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>11</td><td>18</td><td>1</td><td>228</td><td>1990-04-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>15</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>349</td><td>851</td><td>23</td><td>116</td><td>1990-01-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>16</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1376</td><td>2898</td><td>161</td><td>116</td><td>1990-01-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>17</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>444</td><td>1110</td><td>30</td><td>116</td><td>1990-10-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>18</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1949</td><td>3261</td><td>187</td><td>116</td><td>1990-06-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>19</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>381</td><td>814</td><td>22</td><td>116</td><td>1990-02-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>20</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1559</td><td>2772</td><td>154</td><td>116</td><td>1990-02-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td></tr><tr><th>&vellip;</th><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccccccccccccc}\n",
"\t& Origin\\_airport & Destination\\_airport & Origin\\_city & Destination\\_city & Passengers & Seats & Flights & Distance & Fly\\_date & Origin\\_population & Destination\\_population & Org\\_airport\\_lat & Org\\_airport\\_long & Dest\\_airport\\_lat & Dest\\_airport\\_long\\\\\n",
"\t\\hline\n",
"\t& String & String & String & String & Int64 & Int64 & Int64 & Int64 & Date & Int64 & Int64 & String & String & String & String\\\\\n",
"\t\\hline\n",
"\t1 & MHK & AMW & Manhattan, KS & Ames, IA & 21 & 30 & 1 & 254 & 2008-10-01 & 122049 & 86219 & 39.140998840332 & -96.6707992553711 & NA & NA \\\\\n",
"\t2 & EUG & RDM & Eugene, OR & Bend, OR & 41 & 396 & 22 & 103 & 1990-11-01 & 284093 & 76034 & 44.1245994567871 & -123.21199798584 & 44.2541008 & -121.1500015 \\\\\n",
"\t3 & EUG & RDM & Eugene, OR & Bend, OR & 88 & 342 & 19 & 103 & 1990-12-01 & 284093 & 76034 & 44.1245994567871 & -123.21199798584 & 44.2541008 & -121.1500015 \\\\\n",
"\t4 & EUG & RDM & Eugene, OR & Bend, OR & 11 & 72 & 4 & 103 & 1990-10-01 & 284093 & 76034 & 44.1245994567871 & -123.21199798584 & 44.2541008 & -121.1500015 \\\\\n",
"\t5 & MFR & RDM & Medford, OR & Bend, OR & 0 & 18 & 1 & 156 & 1990-02-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 \\\\\n",
"\t6 & MFR & RDM & Medford, OR & Bend, OR & 11 & 18 & 1 & 156 & 1990-03-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 \\\\\n",
"\t7 & MFR & RDM & Medford, OR & Bend, OR & 2 & 72 & 4 & 156 & 1990-01-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 \\\\\n",
"\t8 & MFR & RDM & Medford, OR & Bend, OR & 7 & 18 & 1 & 156 & 1990-09-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 \\\\\n",
"\t9 & MFR & RDM & Medford, OR & Bend, OR & 7 & 36 & 2 & 156 & 1990-11-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 \\\\\n",
"\t10 & SEA & RDM & Seattle, WA & Bend, OR & 8 & 18 & 1 & 228 & 1990-02-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 \\\\\n",
"\t11 & SEA & RDM & Seattle, WA & Bend, OR & 453 & 3128 & 23 & 228 & 1990-01-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 \\\\\n",
"\t12 & SEA & RDM & Seattle, WA & Bend, OR & 784 & 2720 & 20 & 228 & 1990-02-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 \\\\\n",
"\t13 & SEA & RDM & Seattle, WA & Bend, OR & 749 & 2992 & 22 & 228 & 1990-03-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 \\\\\n",
"\t14 & SEA & RDM & Seattle, WA & Bend, OR & 11 & 18 & 1 & 228 & 1990-04-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 \\\\\n",
"\t15 & PDX & RDM & Portland, OR & Bend, OR & 349 & 851 & 23 & 116 & 1990-01-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 \\\\\n",
"\t16 & PDX & RDM & Portland, OR & Bend, OR & 1376 & 2898 & 161 & 116 & 1990-01-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 \\\\\n",
"\t17 & PDX & RDM & Portland, OR & Bend, OR & 444 & 1110 & 30 & 116 & 1990-10-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 \\\\\n",
"\t18 & PDX & RDM & Portland, OR & Bend, OR & 1949 & 3261 & 187 & 116 & 1990-06-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 \\\\\n",
"\t19 & PDX & RDM & Portland, OR & Bend, OR & 381 & 814 & 22 & 116 & 1990-02-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 \\\\\n",
"\t20 & PDX & RDM & Portland, OR & Bend, OR & 1559 & 2772 & 154 & 116 & 1990-02-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m3606803×15 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m Origin_airport \u001b[0m\u001b[1m Destination_airport \u001b[0m\u001b[1m Origin_city \u001b[0m\u001b[1m Destination_city \u001b[0m\u001b[1m Passengers \u001b[0m\u001b[1m Seats \u001b[0m\u001b[1m Flights \u001b[0m\u001b[1m Distance \u001b[0m\u001b[1m Fly_date \u001b[0m\u001b[1m Origin_population \u001b[0m\u001b[1m Destination_population \u001b[0m\u001b[1m Org_airport_lat \u001b[0m\u001b[1m Org_airport_long \u001b[0m\u001b[1m Dest_airport_lat \u001b[0m\u001b[1m Dest_airport_long \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Date \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\n",
"─────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n",
" 1 │ MHK AMW Manhattan, KS Ames, IA 21 30 1 254 2008-10-01 122049 86219 39.140998840332 -96.6707992553711 NA NA\n",
" 2 │ EUG RDM Eugene, OR Bend, OR 41 396 22 103 1990-11-01 284093 76034 44.1245994567871 -123.21199798584 44.2541008 -121.1500015\n",
" 3 │ EUG RDM Eugene, OR Bend, OR 88 342 19 103 1990-12-01 284093 76034 44.1245994567871 -123.21199798584 44.2541008 -121.1500015\n",
" 4 │ EUG RDM Eugene, OR Bend, OR 11 72 4 103 1990-10-01 284093 76034 44.1245994567871 -123.21199798584 44.2541008 -121.1500015\n",
" 5 │ MFR RDM Medford, OR Bend, OR 0 18 1 156 1990-02-01 147300 76034 42.3741989135742 -122.873001098633 44.2541008 -121.1500015\n",
" 6 │ MFR RDM Medford, OR Bend, OR 11 18 1 156 1990-03-01 147300 76034 42.3741989135742 -122.873001098633 44.2541008 -121.1500015\n",
" ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮\n",
" 3606799 │ STL TBN St. Louis, MO Fort Leonard Wood, MO 281 969 51 119 2009-02-01 2828990 46457 38.7486991882324 -90.370002746582 37.74160004 -92.14070129\n",
" 3606800 │ STL TBN St. Louis, MO Fort Leonard Wood, MO 245 1026 54 119 2009-11-01 2828990 46457 38.7486991882324 -90.370002746582 37.74160004 -92.14070129\n",
" 3606801 │ STL TBN St. Louis, MO Fort Leonard Wood, MO 363 1273 67 119 2009-08-01 2828990 46457 38.7486991882324 -90.370002746582 37.74160004 -92.14070129\n",
" 3606802 │ CGI TBN Cape Girardeau, MO Fort Leonard Wood, MO 2 19 1 146 2009-08-01 93712 46457 37.2252998352051 -89.57080078125 37.74160004 -92.14070129\n",
" 3606803 │ FWA OH1 Fort Wayne, IN Washington Court House, OH 0 0 1 135 2003-09-01 398574 28133 40.97850037 -85.19509888 NA NA\n",
"\u001b[31m 3606792 rows omitted\u001b[0m"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Our data frame contains the following columns:\n",
"\n",
"1. `:Origin_airport`: Three letter airport code of the origin airport\n",
"2. `:Destination_airport`: Three letter airport code of the destination airport\n",
"3. `:Origin_city`: Origin city name\n",
"4. `:Destination_city`: Destination city name\n",
"5. `:Passengers`: Number of passengers transported from origin to destination\n",
"6. `:Seats`: Number of seats available on flights from origin to destination\n",
"7. `:Flights`: Number of flights between origin and destination (multiple records for one month, many with flights > 1)\n",
"8. `:Distance`: Distance (to nearest mile) flown between origin and destination\n",
"9. `:Fly_date`: The date (yyyymm) of flight\n",
"10. `:Origin_population`: Origin city's population as reported by US Census\n",
"11. `:Destination_population`: Destination city's population as reported by US Census\n",
"\n",
"Let us first investigate its metadata"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3606803, 15)"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"size(df)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3606803"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"nrow(df)"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"15"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ncol(df)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"15-element Array{String,1}:\n",
" \"Origin_airport\"\n",
" \"Destination_airport\"\n",
" \"Origin_city\"\n",
" \"Destination_city\"\n",
" \"Passengers\"\n",
" \"Seats\"\n",
" \"Flights\"\n",
" \"Distance\"\n",
" \"Fly_date\"\n",
" \"Origin_population\"\n",
" \"Destination_population\"\n",
" \"Org_airport_lat\"\n",
" \"Org_airport_long\"\n",
" \"Dest_airport_lat\"\n",
" \"Dest_airport_long\""
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"names(df)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"15-element Array{Symbol,1}:\n",
" :Origin_airport\n",
" :Destination_airport\n",
" :Origin_city\n",
" :Destination_city\n",
" :Passengers\n",
" :Seats\n",
" :Flights\n",
" :Distance\n",
" :Fly_date\n",
" :Origin_population\n",
" :Destination_population\n",
" :Org_airport_lat\n",
" :Org_airport_long\n",
" :Dest_airport_lat\n",
" :Dest_airport_long"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"propertynames(df)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"An important thing to note is that the `names` function returns a vector of `String`s and the `propertynames` function returns a vector of `Symbol`s.\n",
"\n",
"In DataFrames.jl both strings and `Symbol`s can be used for column indexing."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let us now get some summary statistics of our data set using the `describe` function:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>variable</th><th>mean</th><th>min</th><th>median</th><th>max</th><th>nmissing</th><th>eltype</th></tr><tr><th></th><th>Symbol</th><th>Union…</th><th>Any</th><th>Union…</th><th>Any</th><th>Int64</th><th>DataType</th></tr></thead><tbody><p>15 rows × 7 columns</p><tr><th>1</th><td>Origin_airport</td><td></td><td>1B1</td><td></td><td>ZZV</td><td>0</td><td>String</td></tr><tr><th>2</th><td>Destination_airport</td><td></td><td>1B1</td><td></td><td>ZZV</td><td>0</td><td>String</td></tr><tr><th>3</th><td>Origin_city</td><td></td><td>Aberdeen, SD</td><td></td><td>Zanesville, OH</td><td>0</td><td>String</td></tr><tr><th>4</th><td>Destination_city</td><td></td><td>Aberdeen, SD</td><td></td><td>Zanesville, OH</td><td>0</td><td>String</td></tr><tr><th>5</th><td>Passengers</td><td>2688.91</td><td>0</td><td>1118.0</td><td>89597</td><td>0</td><td>Int64</td></tr><tr><th>6</th><td>Seats</td><td>4048.3</td><td>0</td><td>1998.0</td><td>147062</td><td>0</td><td>Int64</td></tr><tr><th>7</th><td>Flights</td><td>37.2289</td><td>0</td><td>25.0</td><td>1128</td><td>0</td><td>Int64</td></tr><tr><th>8</th><td>Distance</td><td>697.319</td><td>0</td><td>519.0</td><td>5095</td><td>0</td><td>Int64</td></tr><tr><th>9</th><td>Fly_date</td><td></td><td>1990-01-01</td><td></td><td>2009-12-01</td><td>0</td><td>Date</td></tr><tr><th>10</th><td>Origin_population</td><td>5.8715e6</td><td>13005</td><td>2.40019e6</td><td>38139592</td><td>0</td><td>Int64</td></tr><tr><th>11</th><td>Destination_population</td><td>5.89798e6</td><td>12887</td><td>2.40019e6</td><td>38139592</td><td>0</td><td>Int64</td></tr><tr><th>12</th><td>Org_airport_lat</td><td></td><td>19.721399307251</td><td></td><td>NA</td><td>0</td><td>String</td></tr><tr><th>13</th><td>Org_airport_long</td><td></td><td>-100.2860031</td><td></td><td>NA</td><td>0</td><td>String</td></tr><tr><th>14</th><td>Dest_airport_lat</td><td></td><td>19.721399307251</td><td></td><td>NA</td><td>0</td><td>String</td></tr><tr><th>15</th><td>Dest_airport_long</td><td></td><td>-100.2860031</td><td></td><td>NA</td><td>0</td><td>String</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccccc}\n",
"\t& variable & mean & min & median & max & nmissing & eltype\\\\\n",
"\t\\hline\n",
"\t& Symbol & Union… & Any & Union… & Any & Int64 & DataType\\\\\n",
"\t\\hline\n",
"\t1 & Origin\\_airport & & 1B1 & & ZZV & 0 & String \\\\\n",
"\t2 & Destination\\_airport & & 1B1 & & ZZV & 0 & String \\\\\n",
"\t3 & Origin\\_city & & Aberdeen, SD & & Zanesville, OH & 0 & String \\\\\n",
"\t4 & Destination\\_city & & Aberdeen, SD & & Zanesville, OH & 0 & String \\\\\n",
"\t5 & Passengers & 2688.91 & 0 & 1118.0 & 89597 & 0 & Int64 \\\\\n",
"\t6 & Seats & 4048.3 & 0 & 1998.0 & 147062 & 0 & Int64 \\\\\n",
"\t7 & Flights & 37.2289 & 0 & 25.0 & 1128 & 0 & Int64 \\\\\n",
"\t8 & Distance & 697.319 & 0 & 519.0 & 5095 & 0 & Int64 \\\\\n",
"\t9 & Fly\\_date & & 1990-01-01 & & 2009-12-01 & 0 & Date \\\\\n",
"\t10 & Origin\\_population & 5.8715e6 & 13005 & 2.40019e6 & 38139592 & 0 & Int64 \\\\\n",
"\t11 & Destination\\_population & 5.89798e6 & 12887 & 2.40019e6 & 38139592 & 0 & Int64 \\\\\n",
"\t12 & Org\\_airport\\_lat & & 19.721399307251 & & NA & 0 & String \\\\\n",
"\t13 & Org\\_airport\\_long & & -100.2860031 & & NA & 0 & String \\\\\n",
"\t14 & Dest\\_airport\\_lat & & 19.721399307251 & & NA & 0 & String \\\\\n",
"\t15 & Dest\\_airport\\_long & & -100.2860031 & & NA & 0 & String \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m15×7 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m variable \u001b[0m\u001b[1m mean \u001b[0m\u001b[1m min \u001b[0m\u001b[1m median \u001b[0m\u001b[1m max \u001b[0m\u001b[1m nmissing \u001b[0m\u001b[1m eltype \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m Symbol \u001b[0m\u001b[90m Union… \u001b[0m\u001b[90m Any \u001b[0m\u001b[90m Union… \u001b[0m\u001b[90m Any \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m DataType \u001b[0m\n",
"─────┼───────────────────────────────────────────────────────────────────────────────────────────────────\n",
" 1 │ Origin_airport \u001b[90m \u001b[0m 1B1 \u001b[90m \u001b[0m ZZV 0 String\n",
" 2 │ Destination_airport \u001b[90m \u001b[0m 1B1 \u001b[90m \u001b[0m ZZV 0 String\n",
" 3 │ Origin_city \u001b[90m \u001b[0m Aberdeen, SD \u001b[90m \u001b[0m Zanesville, OH 0 String\n",
" 4 │ Destination_city \u001b[90m \u001b[0m Aberdeen, SD \u001b[90m \u001b[0m Zanesville, OH 0 String\n",
" 5 │ Passengers 2688.91 0 1118.0 89597 0 Int64\n",
" 6 │ Seats 4048.3 0 1998.0 147062 0 Int64\n",
" ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮\n",
" 11 │ Destination_population 5.89798e6 12887 2.40019e6 38139592 0 Int64\n",
" 12 │ Org_airport_lat \u001b[90m \u001b[0m 19.721399307251 \u001b[90m \u001b[0m NA 0 String\n",
" 13 │ Org_airport_long \u001b[90m \u001b[0m -100.2860031 \u001b[90m \u001b[0m NA 0 String\n",
" 14 │ Dest_airport_lat \u001b[90m \u001b[0m 19.721399307251 \u001b[90m \u001b[0m NA 0 String\n",
" 15 │ Dest_airport_long \u001b[90m \u001b[0m -100.2860031 \u001b[90m \u001b[0m NA 0 String\n",
"\u001b[31m 4 rows omitted\u001b[0m"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"describe(df)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In particular note that CSV.jl correctly idenfitied `:Fly_date` column as being a `Date` type."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When we investigate the summary statistics we note that there are flights that potentially have `0` passengers, `0` seats, or `0` flights.\n",
"\n",
"In parctice if you get such data it is good to investigate it, as it shows some potential data quality issues.\n",
"\n",
"Let us investigate into it (with a first deep-dive into new features of DataFrames.jl 0.21 release)."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Passengers</th><th>Seats</th><th>Flights</th><th>nrow</th></tr><tr><th></th><th>Bool</th><th>Bool</th><th>Bool</th><th>Int64</th></tr></thead><tbody><p>8 rows × 4 columns</p><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>11239</td></tr><tr><th>2</th><td>0</td><td>0</td><td>1</td><td>322787</td></tr><tr><th>3</th><td>0</td><td>1</td><td>0</td><td>94</td></tr><tr><th>4</th><td>0</td><td>1</td><td>1</td><td>51772</td></tr><tr><th>5</th><td>1</td><td>0</td><td>0</td><td>7</td></tr><tr><th>6</th><td>1</td><td>0</td><td>1</td><td>3</td></tr><tr><th>7</th><td>1</td><td>1</td><td>0</td><td>56</td></tr><tr><th>8</th><td>1</td><td>1</td><td>1</td><td>3220845</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cccc}\n",
"\t& Passengers & Seats & Flights & nrow\\\\\n",
"\t\\hline\n",
"\t& Bool & Bool & Bool & Int64\\\\\n",
"\t\\hline\n",
"\t1 & 0 & 0 & 0 & 11239 \\\\\n",
"\t2 & 0 & 0 & 1 & 322787 \\\\\n",
"\t3 & 0 & 1 & 0 & 94 \\\\\n",
"\t4 & 0 & 1 & 1 & 51772 \\\\\n",
"\t5 & 1 & 0 & 0 & 7 \\\\\n",
"\t6 & 1 & 0 & 1 & 3 \\\\\n",
"\t7 & 1 & 1 & 0 & 56 \\\\\n",
"\t8 & 1 & 1 & 1 & 3220845 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m8×4 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m Passengers \u001b[0m\u001b[1m Seats \u001b[0m\u001b[1m Flights \u001b[0m\u001b[1m nrow \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m Bool \u001b[0m\u001b[90m Bool \u001b[0m\u001b[90m Bool \u001b[0m\u001b[90m Int64 \u001b[0m\n",
"─────┼─────────────────────────────────────\n",
" 1 │ false false false 11239\n",
" 2 │ false false true 322787\n",
" 3 │ false true false 94\n",
" 4 │ false true true 51772\n",
" 5 │ true false false 7\n",
" 6 │ true false true 3\n",
" 7 │ true true false 56\n",
" 8 │ true true true 3220845"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@pipe df |>\n",
" select(_, :Passengers, :Seats, :Flights) |>\n",
" mapcols(x -> x .> 0, _) |>\n",
" groupby(_, :, sort=true) |>\n",
" combine(_, nrow)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Before interpreting the results let us dissect the code:\n",
"1. `@pipe` is a macro from Pipe.jl package, that makes it easy to chain function calls and makes `_` a placeholder for a value returned by a function that was earlier in the chain (you can read about the details here: https://github.com/oxinabox/Pipe.jl)\n",
"2. `select` creates a new data frame that keeps only three columns that we are interested in\n",
"3. `mapcols` transforms each column of our data frame to have `Bool` element; it will have a value `true` if an entry is greater than `0` and `false` otherwise. In this way we are able to easily idenfity rows with `0` entries, as they are most interesting for us\n",
"4. `groupby` groups our data frame by all columns and tells DataFrames.jl that the gorups should be sorted\n",
"5. finally `combine` just counts the number of rows in each group"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now going to our results - some of entries can be explained, like `0` passenges, but some seats and some flights (I guess it means that just no one took some flight).\n",
"\n",
"However cases like some passengers, but `0` seats and `0` flights are probably a mistake in data (we have 7 rows that have this combination of values).\n",
"\n",
"Let us try to find these 7 rows in two ways:"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Origin_airport</th><th>Destination_airport</th><th>Origin_city</th><th>Destination_city</th><th>Passengers</th><th>Seats</th><th>Flights</th><th>Distance</th><th>Fly_date</th><th>Origin_population</th><th>Destination_population</th><th>Org_airport_lat</th><th>Org_airport_long</th><th>Dest_airport_lat</th><th>Dest_airport_long</th></tr><tr><th></th><th>String</th><th>String</th><th>String</th><th>String</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Date</th><th>Int64</th><th>Int64</th><th>String</th><th>String</th><th>String</th><th>String</th></tr></thead><tbody><p>7 rows × 15 columns</p><tr><th>1</th><td>ABR</td><td>PIR</td><td>Aberdeen, SD</td><td>Pierre, SD</td><td>11</td><td>0</td><td>0</td><td>117</td><td>1997-11-01</td><td>39903</td><td>18289</td><td>45.4491004943848</td><td>-98.4217987060547</td><td>44.38270187</td><td>-100.2860031</td></tr><tr><th>2</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>2</td><td>0</td><td>0</td><td>215</td><td>2002-12-01</td><td>10029142</td><td>78851</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>3</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>1</td><td>0</td><td>0</td><td>215</td><td>2003-02-01</td><td>10172752</td><td>78587</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>4</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>2</td><td>0</td><td>0</td><td>215</td><td>2003-03-01</td><td>10172752</td><td>78587</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>5</th><td>BOS</td><td>LAS</td><td>Boston, MA</td><td>Las Vegas, NV</td><td>9</td><td>0</td><td>0</td><td>2381</td><td>1993-06-01</td><td>8260582</td><td>877917</td><td>42.36429977</td><td>-71.00520325</td><td>36.08010101</td><td>-115.1520004</td></tr><tr><th>6</th><td>BKW</td><td>IAD</td><td>Beckley, WV</td><td>Washington, DC</td><td>7</td><td>0</td><td>0</td><td>215</td><td>2002-12-01</td><td>78851</td><td>10029142</td><td>37.7873001099</td><td>-81.1241989136</td><td>38.94449997</td><td>-77.45580292</td></tr><tr><th>7</th><td>CMI</td><td>BMI</td><td>Champaign, IL</td><td>Bloomington, IL</td><td>6</td><td>0</td><td>0</td><td>46</td><td>1997-11-01</td><td>201107</td><td>141699</td><td>40.03919983</td><td>-88.27809906</td><td>40.47710037</td><td>-88.91590118</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccccccccccccc}\n",
"\t& Origin\\_airport & Destination\\_airport & Origin\\_city & Destination\\_city & Passengers & Seats & Flights & Distance & Fly\\_date & Origin\\_population & Destination\\_population & Org\\_airport\\_lat & Org\\_airport\\_long & Dest\\_airport\\_lat & Dest\\_airport\\_long\\\\\n",
"\t\\hline\n",
"\t& String & String & String & String & Int64 & Int64 & Int64 & Int64 & Date & Int64 & Int64 & String & String & String & String\\\\\n",
"\t\\hline\n",
"\t1 & ABR & PIR & Aberdeen, SD & Pierre, SD & 11 & 0 & 0 & 117 & 1997-11-01 & 39903 & 18289 & 45.4491004943848 & -98.4217987060547 & 44.38270187 & -100.2860031 \\\\\n",
"\t2 & IAD & BKW & Washington, DC & Beckley, WV & 2 & 0 & 0 & 215 & 2002-12-01 & 10029142 & 78851 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t3 & IAD & BKW & Washington, DC & Beckley, WV & 1 & 0 & 0 & 215 & 2003-02-01 & 10172752 & 78587 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t4 & IAD & BKW & Washington, DC & Beckley, WV & 2 & 0 & 0 & 215 & 2003-03-01 & 10172752 & 78587 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t5 & BOS & LAS & Boston, MA & Las Vegas, NV & 9 & 0 & 0 & 2381 & 1993-06-01 & 8260582 & 877917 & 42.36429977 & -71.00520325 & 36.08010101 & -115.1520004 \\\\\n",
"\t6 & BKW & IAD & Beckley, WV & Washington, DC & 7 & 0 & 0 & 215 & 2002-12-01 & 78851 & 10029142 & 37.7873001099 & -81.1241989136 & 38.94449997 & -77.45580292 \\\\\n",
"\t7 & CMI & BMI & Champaign, IL & Bloomington, IL & 6 & 0 & 0 & 46 & 1997-11-01 & 201107 & 141699 & 40.03919983 & -88.27809906 & 40.47710037 & -88.91590118 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m7×15 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m Origin_airport \u001b[0m\u001b[1m Destination_airport \u001b[0m\u001b[1m Origin_city \u001b[0m\u001b[1m Destination_city \u001b[0m\u001b[1m Passengers \u001b[0m\u001b[1m Seats \u001b[0m\u001b[1m Flights \u001b[0m\u001b[1m Distance \u001b[0m\u001b[1m Fly_date \u001b[0m\u001b[1m Origin_population \u001b[0m\u001b[1m Destination_population \u001b[0m\u001b[1m Org_airport_lat \u001b[0m\u001b[1m Org_airport_long \u001b[0m\u001b[1m Dest_airport_lat \u001b[0m\u001b[1m Dest_airport_long \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Date \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\n",
"─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n",
" 1 │ ABR PIR Aberdeen, SD Pierre, SD 11 0 0 117 1997-11-01 39903 18289 45.4491004943848 -98.4217987060547 44.38270187 -100.2860031\n",
" 2 │ IAD BKW Washington, DC Beckley, WV 2 0 0 215 2002-12-01 10029142 78851 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 3 │ IAD BKW Washington, DC Beckley, WV 1 0 0 215 2003-02-01 10172752 78587 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 4 │ IAD BKW Washington, DC Beckley, WV 2 0 0 215 2003-03-01 10172752 78587 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 5 │ BOS LAS Boston, MA Las Vegas, NV 9 0 0 2381 1993-06-01 8260582 877917 42.36429977 -71.00520325 36.08010101 -115.1520004\n",
" 6 │ BKW IAD Beckley, WV Washington, DC 7 0 0 215 2002-12-01 78851 10029142 37.7873001099 -81.1241989136 38.94449997 -77.45580292\n",
" 7 │ CMI BMI Champaign, IL Bloomington, IL 6 0 0 46 1997-11-01 201107 141699 40.03919983 -88.27809906 40.47710037 -88.91590118"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filter(row -> row.Passengers > 0 && row.Seats == 0 && row.Flights == 0, df)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Origin_airport</th><th>Destination_airport</th><th>Origin_city</th><th>Destination_city</th><th>Passengers</th><th>Seats</th><th>Flights</th><th>Distance</th><th>Fly_date</th><th>Origin_population</th><th>Destination_population</th><th>Org_airport_lat</th><th>Org_airport_long</th><th>Dest_airport_lat</th><th>Dest_airport_long</th></tr><tr><th></th><th>String</th><th>String</th><th>String</th><th>String</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Date</th><th>Int64</th><th>Int64</th><th>String</th><th>String</th><th>String</th><th>String</th></tr></thead><tbody><p>7 rows × 15 columns</p><tr><th>1</th><td>ABR</td><td>PIR</td><td>Aberdeen, SD</td><td>Pierre, SD</td><td>11</td><td>0</td><td>0</td><td>117</td><td>1997-11-01</td><td>39903</td><td>18289</td><td>45.4491004943848</td><td>-98.4217987060547</td><td>44.38270187</td><td>-100.2860031</td></tr><tr><th>2</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>2</td><td>0</td><td>0</td><td>215</td><td>2002-12-01</td><td>10029142</td><td>78851</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>3</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>1</td><td>0</td><td>0</td><td>215</td><td>2003-02-01</td><td>10172752</td><td>78587</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>4</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>2</td><td>0</td><td>0</td><td>215</td><td>2003-03-01</td><td>10172752</td><td>78587</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>5</th><td>BOS</td><td>LAS</td><td>Boston, MA</td><td>Las Vegas, NV</td><td>9</td><td>0</td><td>0</td><td>2381</td><td>1993-06-01</td><td>8260582</td><td>877917</td><td>42.36429977</td><td>-71.00520325</td><td>36.08010101</td><td>-115.1520004</td></tr><tr><th>6</th><td>BKW</td><td>IAD</td><td>Beckley, WV</td><td>Washington, DC</td><td>7</td><td>0</td><td>0</td><td>215</td><td>2002-12-01</td><td>78851</td><td>10029142</td><td>37.7873001099</td><td>-81.1241989136</td><td>38.94449997</td><td>-77.45580292</td></tr><tr><th>7</th><td>CMI</td><td>BMI</td><td>Champaign, IL</td><td>Bloomington, IL</td><td>6</td><td>0</td><td>0</td><td>46</td><td>1997-11-01</td><td>201107</td><td>141699</td><td>40.03919983</td><td>-88.27809906</td><td>40.47710037</td><td>-88.91590118</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccccccccccccc}\n",
"\t& Origin\\_airport & Destination\\_airport & Origin\\_city & Destination\\_city & Passengers & Seats & Flights & Distance & Fly\\_date & Origin\\_population & Destination\\_population & Org\\_airport\\_lat & Org\\_airport\\_long & Dest\\_airport\\_lat & Dest\\_airport\\_long\\\\\n",
"\t\\hline\n",
"\t& String & String & String & String & Int64 & Int64 & Int64 & Int64 & Date & Int64 & Int64 & String & String & String & String\\\\\n",
"\t\\hline\n",
"\t1 & ABR & PIR & Aberdeen, SD & Pierre, SD & 11 & 0 & 0 & 117 & 1997-11-01 & 39903 & 18289 & 45.4491004943848 & -98.4217987060547 & 44.38270187 & -100.2860031 \\\\\n",
"\t2 & IAD & BKW & Washington, DC & Beckley, WV & 2 & 0 & 0 & 215 & 2002-12-01 & 10029142 & 78851 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t3 & IAD & BKW & Washington, DC & Beckley, WV & 1 & 0 & 0 & 215 & 2003-02-01 & 10172752 & 78587 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t4 & IAD & BKW & Washington, DC & Beckley, WV & 2 & 0 & 0 & 215 & 2003-03-01 & 10172752 & 78587 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t5 & BOS & LAS & Boston, MA & Las Vegas, NV & 9 & 0 & 0 & 2381 & 1993-06-01 & 8260582 & 877917 & 42.36429977 & -71.00520325 & 36.08010101 & -115.1520004 \\\\\n",
"\t6 & BKW & IAD & Beckley, WV & Washington, DC & 7 & 0 & 0 & 215 & 2002-12-01 & 78851 & 10029142 & 37.7873001099 & -81.1241989136 & 38.94449997 & -77.45580292 \\\\\n",
"\t7 & CMI & BMI & Champaign, IL & Bloomington, IL & 6 & 0 & 0 & 46 & 1997-11-01 & 201107 & 141699 & 40.03919983 & -88.27809906 & 40.47710037 & -88.91590118 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m7×15 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m Origin_airport \u001b[0m\u001b[1m Destination_airport \u001b[0m\u001b[1m Origin_city \u001b[0m\u001b[1m Destination_city \u001b[0m\u001b[1m Passengers \u001b[0m\u001b[1m Seats \u001b[0m\u001b[1m Flights \u001b[0m\u001b[1m Distance \u001b[0m\u001b[1m Fly_date \u001b[0m\u001b[1m Origin_population \u001b[0m\u001b[1m Destination_population \u001b[0m\u001b[1m Org_airport_lat \u001b[0m\u001b[1m Org_airport_long \u001b[0m\u001b[1m Dest_airport_lat \u001b[0m\u001b[1m Dest_airport_long \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Date \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\n",
"─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n",
" 1 │ ABR PIR Aberdeen, SD Pierre, SD 11 0 0 117 1997-11-01 39903 18289 45.4491004943848 -98.4217987060547 44.38270187 -100.2860031\n",
" 2 │ IAD BKW Washington, DC Beckley, WV 2 0 0 215 2002-12-01 10029142 78851 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 3 │ IAD BKW Washington, DC Beckley, WV 1 0 0 215 2003-02-01 10172752 78587 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 4 │ IAD BKW Washington, DC Beckley, WV 2 0 0 215 2003-03-01 10172752 78587 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 5 │ BOS LAS Boston, MA Las Vegas, NV 9 0 0 2381 1993-06-01 8260582 877917 42.36429977 -71.00520325 36.08010101 -115.1520004\n",
" 6 │ BKW IAD Beckley, WV Washington, DC 7 0 0 215 2002-12-01 78851 10029142 37.7873001099 -81.1241989136 38.94449997 -77.45580292\n",
" 7 │ CMI BMI Champaign, IL Bloomington, IL 6 0 0 46 1997-11-01 201107 141699 40.03919983 -88.27809906 40.47710037 -88.91590118"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filter([:Passengers, :Seats, :Flights] => (x...) -> x[1] > 0 && x[2] == 0 && x[3] == 0, df)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Origin_airport</th><th>Destination_airport</th><th>Origin_city</th><th>Destination_city</th><th>Passengers</th><th>Seats</th><th>Flights</th><th>Distance</th><th>Fly_date</th><th>Origin_population</th><th>Destination_population</th><th>Org_airport_lat</th><th>Org_airport_long</th><th>Dest_airport_lat</th><th>Dest_airport_long</th></tr><tr><th></th><th>String</th><th>String</th><th>String</th><th>String</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Date</th><th>Int64</th><th>Int64</th><th>String</th><th>String</th><th>String</th><th>String</th></tr></thead><tbody><p>7 rows × 15 columns</p><tr><th>1</th><td>ABR</td><td>PIR</td><td>Aberdeen, SD</td><td>Pierre, SD</td><td>11</td><td>0</td><td>0</td><td>117</td><td>1997-11-01</td><td>39903</td><td>18289</td><td>45.4491004943848</td><td>-98.4217987060547</td><td>44.38270187</td><td>-100.2860031</td></tr><tr><th>2</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>2</td><td>0</td><td>0</td><td>215</td><td>2002-12-01</td><td>10029142</td><td>78851</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>3</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>1</td><td>0</td><td>0</td><td>215</td><td>2003-02-01</td><td>10172752</td><td>78587</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>4</th><td>IAD</td><td>BKW</td><td>Washington, DC</td><td>Beckley, WV</td><td>2</td><td>0</td><td>0</td><td>215</td><td>2003-03-01</td><td>10172752</td><td>78587</td><td>38.94449997</td><td>-77.45580292</td><td>37.7873001099</td><td>-81.1241989136</td></tr><tr><th>5</th><td>BOS</td><td>LAS</td><td>Boston, MA</td><td>Las Vegas, NV</td><td>9</td><td>0</td><td>0</td><td>2381</td><td>1993-06-01</td><td>8260582</td><td>877917</td><td>42.36429977</td><td>-71.00520325</td><td>36.08010101</td><td>-115.1520004</td></tr><tr><th>6</th><td>BKW</td><td>IAD</td><td>Beckley, WV</td><td>Washington, DC</td><td>7</td><td>0</td><td>0</td><td>215</td><td>2002-12-01</td><td>78851</td><td>10029142</td><td>37.7873001099</td><td>-81.1241989136</td><td>38.94449997</td><td>-77.45580292</td></tr><tr><th>7</th><td>CMI</td><td>BMI</td><td>Champaign, IL</td><td>Bloomington, IL</td><td>6</td><td>0</td><td>0</td><td>46</td><td>1997-11-01</td><td>201107</td><td>141699</td><td>40.03919983</td><td>-88.27809906</td><td>40.47710037</td><td>-88.91590118</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccccccccccccc}\n",
"\t& Origin\\_airport & Destination\\_airport & Origin\\_city & Destination\\_city & Passengers & Seats & Flights & Distance & Fly\\_date & Origin\\_population & Destination\\_population & Org\\_airport\\_lat & Org\\_airport\\_long & Dest\\_airport\\_lat & Dest\\_airport\\_long\\\\\n",
"\t\\hline\n",
"\t& String & String & String & String & Int64 & Int64 & Int64 & Int64 & Date & Int64 & Int64 & String & String & String & String\\\\\n",
"\t\\hline\n",
"\t1 & ABR & PIR & Aberdeen, SD & Pierre, SD & 11 & 0 & 0 & 117 & 1997-11-01 & 39903 & 18289 & 45.4491004943848 & -98.4217987060547 & 44.38270187 & -100.2860031 \\\\\n",
"\t2 & IAD & BKW & Washington, DC & Beckley, WV & 2 & 0 & 0 & 215 & 2002-12-01 & 10029142 & 78851 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t3 & IAD & BKW & Washington, DC & Beckley, WV & 1 & 0 & 0 & 215 & 2003-02-01 & 10172752 & 78587 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t4 & IAD & BKW & Washington, DC & Beckley, WV & 2 & 0 & 0 & 215 & 2003-03-01 & 10172752 & 78587 & 38.94449997 & -77.45580292 & 37.7873001099 & -81.1241989136 \\\\\n",
"\t5 & BOS & LAS & Boston, MA & Las Vegas, NV & 9 & 0 & 0 & 2381 & 1993-06-01 & 8260582 & 877917 & 42.36429977 & -71.00520325 & 36.08010101 & -115.1520004 \\\\\n",
"\t6 & BKW & IAD & Beckley, WV & Washington, DC & 7 & 0 & 0 & 215 & 2002-12-01 & 78851 & 10029142 & 37.7873001099 & -81.1241989136 & 38.94449997 & -77.45580292 \\\\\n",
"\t7 & CMI & BMI & Champaign, IL & Bloomington, IL & 6 & 0 & 0 & 46 & 1997-11-01 & 201107 & 141699 & 40.03919983 & -88.27809906 & 40.47710037 & -88.91590118 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m7×15 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m Origin_airport \u001b[0m\u001b[1m Destination_airport \u001b[0m\u001b[1m Origin_city \u001b[0m\u001b[1m Destination_city \u001b[0m\u001b[1m Passengers \u001b[0m\u001b[1m Seats \u001b[0m\u001b[1m Flights \u001b[0m\u001b[1m Distance \u001b[0m\u001b[1m Fly_date \u001b[0m\u001b[1m Origin_population \u001b[0m\u001b[1m Destination_population \u001b[0m\u001b[1m Org_airport_lat \u001b[0m\u001b[1m Org_airport_long \u001b[0m\u001b[1m Dest_airport_lat \u001b[0m\u001b[1m Dest_airport_long \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Date \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\n",
"─────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n",
" 1 │ ABR PIR Aberdeen, SD Pierre, SD 11 0 0 117 1997-11-01 39903 18289 45.4491004943848 -98.4217987060547 44.38270187 -100.2860031\n",
" 2 │ IAD BKW Washington, DC Beckley, WV 2 0 0 215 2002-12-01 10029142 78851 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 3 │ IAD BKW Washington, DC Beckley, WV 1 0 0 215 2003-02-01 10172752 78587 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 4 │ IAD BKW Washington, DC Beckley, WV 2 0 0 215 2003-03-01 10172752 78587 38.94449997 -77.45580292 37.7873001099 -81.1241989136\n",
" 5 │ BOS LAS Boston, MA Las Vegas, NV 9 0 0 2381 1993-06-01 8260582 877917 42.36429977 -71.00520325 36.08010101 -115.1520004\n",
" 6 │ BKW IAD Beckley, WV Washington, DC 7 0 0 215 2002-12-01 78851 10029142 37.7873001099 -81.1241989136 38.94449997 -77.45580292\n",
" 7 │ CMI BMI Champaign, IL Bloomington, IL 6 0 0 46 1997-11-01 201107 141699 40.03919983 -88.27809906 40.47710037 -88.91590118"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filter(AsTable(:) => row -> row.Passengers > 0 && row.Seats == 0 && row.Flights == 0, df)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The second form is a new feature of DataFrames.jl 0.21 release and it allows passing only selected columns to a predicate function. The benefit is that this operation is type stable.\n",
"\n",
"Let us compare the timing of both options:"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.765999 seconds (18.73 M allocations: 307.128 MiB)\n"
]
}
],
"source": [
"@time filter(row -> row.Passengers > 0 && row.Seats == 0 && row.Flights == 0, df);"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.168150 seconds (425.74 k allocations: 20.100 MiB)\n"
]
}
],
"source": [
"@time filter([:Passengers, :Seats, :Flights] => (x...) -> x[1] > 0 && x[2] == 0 && x[3] == 0, df);"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let us move to another analysis.\n",
"\n",
"We want to get an information about the occupancy of each flight. It can be calculated as ratio of the number of passengers and number of seats time number of flights. The problem is that if there are `0` seats or flights we would be dividing by `0` and get a `NaN` result. We prefer to get a `missing` value in this case. Therefore first define a helper function:"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"get_occupied (generic function with 1 method)"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"function get_occupied(passengers, seats, flights)\n",
" if seats == 0 || flights == 0\n",
" return missing\n",
" else\n",
" return passengers / (seats * flights)\n",
" end\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"and now we use it to add a new column to our data frame. Additionally we create three new columns:\n",
"1. `:ost`: state of the origin city\n",
"2. `:dst`: state of the destination city\n",
"3. `:year`: year of flight"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Origin_airport</th><th>Destination_airport</th><th>Origin_city</th><th>Destination_city</th><th>Passengers</th><th>Seats</th><th>Flights</th><th>Distance</th><th>Fly_date</th><th>Origin_population</th><th>Destination_population</th><th>Org_airport_lat</th><th>Org_airport_long</th><th>Dest_airport_lat</th><th>Dest_airport_long</th><th>occupied</th><th>ost</th><th>dst</th><th>year</th></tr><tr><th></th><th>String</th><th>String</th><th>String</th><th>String</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Int64</th><th>Date</th><th>Int64</th><th>Int64</th><th>String</th><th>String</th><th>String</th><th>String</th><th>Float64?</th><th>String</th><th>String</th><th>Int64</th></tr></thead><tbody><p>3,606,803 rows × 19 columns</p><tr><th>1</th><td>MHK</td><td>AMW</td><td>Manhattan, KS</td><td>Ames, IA</td><td>21</td><td>30</td><td>1</td><td>254</td><td>2008-10-01</td><td>122049</td><td>86219</td><td>39.140998840332</td><td>-96.6707992553711</td><td>NA</td><td>NA</td><td>0.7</td><td>KS</td><td>IA</td><td>2008</td></tr><tr><th>2</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>41</td><td>396</td><td>22</td><td>103</td><td>1990-11-01</td><td>284093</td><td>76034</td><td>44.1245994567871</td><td>-123.21199798584</td><td>44.2541008</td><td>-121.1500015</td><td>0.00470615</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>3</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>88</td><td>342</td><td>19</td><td>103</td><td>1990-12-01</td><td>284093</td><td>76034</td><td>44.1245994567871</td><td>-123.21199798584</td><td>44.2541008</td><td>-121.1500015</td><td>0.0135426</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>4</th><td>EUG</td><td>RDM</td><td>Eugene, OR</td><td>Bend, OR</td><td>11</td><td>72</td><td>4</td><td>103</td><td>1990-10-01</td><td>284093</td><td>76034</td><td>44.1245994567871</td><td>-123.21199798584</td><td>44.2541008</td><td>-121.1500015</td><td>0.0381944</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>5</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>0</td><td>18</td><td>1</td><td>156</td><td>1990-02-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td><td>0.0</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>6</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>11</td><td>18</td><td>1</td><td>156</td><td>1990-03-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td><td>0.611111</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>7</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>2</td><td>72</td><td>4</td><td>156</td><td>1990-01-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td><td>0.00694444</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>8</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>7</td><td>18</td><td>1</td><td>156</td><td>1990-09-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td><td>0.388889</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>9</th><td>MFR</td><td>RDM</td><td>Medford, OR</td><td>Bend, OR</td><td>7</td><td>36</td><td>2</td><td>156</td><td>1990-11-01</td><td>147300</td><td>76034</td><td>42.3741989135742</td><td>-122.873001098633</td><td>44.2541008</td><td>-121.1500015</td><td>0.0972222</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>10</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>8</td><td>18</td><td>1</td><td>228</td><td>1990-02-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td><td>0.444444</td><td>WA</td><td>OR</td><td>1990</td></tr><tr><th>11</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>453</td><td>3128</td><td>23</td><td>228</td><td>1990-01-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td><td>0.00629656</td><td>WA</td><td>OR</td><td>1990</td></tr><tr><th>12</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>784</td><td>2720</td><td>20</td><td>228</td><td>1990-02-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td><td>0.0144118</td><td>WA</td><td>OR</td><td>1990</td></tr><tr><th>13</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>749</td><td>2992</td><td>22</td><td>228</td><td>1990-03-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td><td>0.0113788</td><td>WA</td><td>OR</td><td>1990</td></tr><tr><th>14</th><td>SEA</td><td>RDM</td><td>Seattle, WA</td><td>Bend, OR</td><td>11</td><td>18</td><td>1</td><td>228</td><td>1990-04-01</td><td>5154164</td><td>76034</td><td>47.4490013122559</td><td>-122.30899810791</td><td>44.2541008</td><td>-121.1500015</td><td>0.611111</td><td>WA</td><td>OR</td><td>1990</td></tr><tr><th>15</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>349</td><td>851</td><td>23</td><td>116</td><td>1990-01-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td><td>0.0178307</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>16</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1376</td><td>2898</td><td>161</td><td>116</td><td>1990-01-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td><td>0.00294913</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>17</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>444</td><td>1110</td><td>30</td><td>116</td><td>1990-10-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td><td>0.0133333</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>18</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1949</td><td>3261</td><td>187</td><td>116</td><td>1990-06-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td><td>0.00319609</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>19</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>381</td><td>814</td><td>22</td><td>116</td><td>1990-02-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td><td>0.0212754</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>20</th><td>PDX</td><td>RDM</td><td>Portland, OR</td><td>Bend, OR</td><td>1559</td><td>2772</td><td>154</td><td>116</td><td>1990-02-01</td><td>1534762</td><td>76034</td><td>45.58869934</td><td>-122.5979996</td><td>44.2541008</td><td>-121.1500015</td><td>0.00365201</td><td>OR</td><td>OR</td><td>1990</td></tr><tr><th>&vellip;</th><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccccccccccccccccc}\n",
"\t& Origin\\_airport & Destination\\_airport & Origin\\_city & Destination\\_city & Passengers & Seats & Flights & Distance & Fly\\_date & Origin\\_population & Destination\\_population & Org\\_airport\\_lat & Org\\_airport\\_long & Dest\\_airport\\_lat & Dest\\_airport\\_long & occupied & ost & dst & year\\\\\n",
"\t\\hline\n",
"\t& String & String & String & String & Int64 & Int64 & Int64 & Int64 & Date & Int64 & Int64 & String & String & String & String & Float64? & String & String & Int64\\\\\n",
"\t\\hline\n",
"\t1 & MHK & AMW & Manhattan, KS & Ames, IA & 21 & 30 & 1 & 254 & 2008-10-01 & 122049 & 86219 & 39.140998840332 & -96.6707992553711 & NA & NA & 0.7 & KS & IA & 2008 \\\\\n",
"\t2 & EUG & RDM & Eugene, OR & Bend, OR & 41 & 396 & 22 & 103 & 1990-11-01 & 284093 & 76034 & 44.1245994567871 & -123.21199798584 & 44.2541008 & -121.1500015 & 0.00470615 & OR & OR & 1990 \\\\\n",
"\t3 & EUG & RDM & Eugene, OR & Bend, OR & 88 & 342 & 19 & 103 & 1990-12-01 & 284093 & 76034 & 44.1245994567871 & -123.21199798584 & 44.2541008 & -121.1500015 & 0.0135426 & OR & OR & 1990 \\\\\n",
"\t4 & EUG & RDM & Eugene, OR & Bend, OR & 11 & 72 & 4 & 103 & 1990-10-01 & 284093 & 76034 & 44.1245994567871 & -123.21199798584 & 44.2541008 & -121.1500015 & 0.0381944 & OR & OR & 1990 \\\\\n",
"\t5 & MFR & RDM & Medford, OR & Bend, OR & 0 & 18 & 1 & 156 & 1990-02-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 & 0.0 & OR & OR & 1990 \\\\\n",
"\t6 & MFR & RDM & Medford, OR & Bend, OR & 11 & 18 & 1 & 156 & 1990-03-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 & 0.611111 & OR & OR & 1990 \\\\\n",
"\t7 & MFR & RDM & Medford, OR & Bend, OR & 2 & 72 & 4 & 156 & 1990-01-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 & 0.00694444 & OR & OR & 1990 \\\\\n",
"\t8 & MFR & RDM & Medford, OR & Bend, OR & 7 & 18 & 1 & 156 & 1990-09-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 & 0.388889 & OR & OR & 1990 \\\\\n",
"\t9 & MFR & RDM & Medford, OR & Bend, OR & 7 & 36 & 2 & 156 & 1990-11-01 & 147300 & 76034 & 42.3741989135742 & -122.873001098633 & 44.2541008 & -121.1500015 & 0.0972222 & OR & OR & 1990 \\\\\n",
"\t10 & SEA & RDM & Seattle, WA & Bend, OR & 8 & 18 & 1 & 228 & 1990-02-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 & 0.444444 & WA & OR & 1990 \\\\\n",
"\t11 & SEA & RDM & Seattle, WA & Bend, OR & 453 & 3128 & 23 & 228 & 1990-01-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 & 0.00629656 & WA & OR & 1990 \\\\\n",
"\t12 & SEA & RDM & Seattle, WA & Bend, OR & 784 & 2720 & 20 & 228 & 1990-02-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 & 0.0144118 & WA & OR & 1990 \\\\\n",
"\t13 & SEA & RDM & Seattle, WA & Bend, OR & 749 & 2992 & 22 & 228 & 1990-03-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 & 0.0113788 & WA & OR & 1990 \\\\\n",
"\t14 & SEA & RDM & Seattle, WA & Bend, OR & 11 & 18 & 1 & 228 & 1990-04-01 & 5154164 & 76034 & 47.4490013122559 & -122.30899810791 & 44.2541008 & -121.1500015 & 0.611111 & WA & OR & 1990 \\\\\n",
"\t15 & PDX & RDM & Portland, OR & Bend, OR & 349 & 851 & 23 & 116 & 1990-01-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 & 0.0178307 & OR & OR & 1990 \\\\\n",
"\t16 & PDX & RDM & Portland, OR & Bend, OR & 1376 & 2898 & 161 & 116 & 1990-01-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 & 0.00294913 & OR & OR & 1990 \\\\\n",
"\t17 & PDX & RDM & Portland, OR & Bend, OR & 444 & 1110 & 30 & 116 & 1990-10-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 & 0.0133333 & OR & OR & 1990 \\\\\n",
"\t18 & PDX & RDM & Portland, OR & Bend, OR & 1949 & 3261 & 187 & 116 & 1990-06-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 & 0.00319609 & OR & OR & 1990 \\\\\n",
"\t19 & PDX & RDM & Portland, OR & Bend, OR & 381 & 814 & 22 & 116 & 1990-02-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 & 0.0212754 & OR & OR & 1990 \\\\\n",
"\t20 & PDX & RDM & Portland, OR & Bend, OR & 1559 & 2772 & 154 & 116 & 1990-02-01 & 1534762 & 76034 & 45.58869934 & -122.5979996 & 44.2541008 & -121.1500015 & 0.00365201 & OR & OR & 1990 \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m3606803×19 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m Origin_airport \u001b[0m\u001b[1m Destination_airport \u001b[0m\u001b[1m Origin_city \u001b[0m\u001b[1m Destination_city \u001b[0m\u001b[1m Passengers \u001b[0m\u001b[1m Seats \u001b[0m\u001b[1m Flights \u001b[0m\u001b[1m Distance \u001b[0m\u001b[1m Fly_date \u001b[0m\u001b[1m Origin_population \u001b[0m\u001b[1m Destination_population \u001b[0m\u001b[1m Org_airport_lat \u001b[0m\u001b[1m Org_airport_long \u001b[0m\u001b[1m Dest_airport_lat \u001b[0m\u001b[1m Dest_airport_long \u001b[0m\u001b[1m occupied \u001b[0m\u001b[1m ost \u001b[0m\u001b[1m dst \u001b[0m\u001b[1m year \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Date \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m Int64 \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Float64? \u001b[0m\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Int64 \u001b[0m\n",
"─────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────\n",
" 1 │ MHK AMW Manhattan, KS Ames, IA 21 30 1 254 2008-10-01 122049 86219 39.140998840332 -96.6707992553711 NA NA 0.7 KS IA 2008\n",
" 2 │ EUG RDM Eugene, OR Bend, OR 41 396 22 103 1990-11-01 284093 76034 44.1245994567871 -123.21199798584 44.2541008 -121.1500015 0.00470615 OR OR 1990\n",
" 3 │ EUG RDM Eugene, OR Bend, OR 88 342 19 103 1990-12-01 284093 76034 44.1245994567871 -123.21199798584 44.2541008 -121.1500015 0.0135426 OR OR 1990\n",
" 4 │ EUG RDM Eugene, OR Bend, OR 11 72 4 103 1990-10-01 284093 76034 44.1245994567871 -123.21199798584 44.2541008 -121.1500015 0.0381944 OR OR 1990\n",
" 5 │ MFR RDM Medford, OR Bend, OR 0 18 1 156 1990-02-01 147300 76034 42.3741989135742 -122.873001098633 44.2541008 -121.1500015 0.0 OR OR 1990\n",
" 6 │ MFR RDM Medford, OR Bend, OR 11 18 1 156 1990-03-01 147300 76034 42.3741989135742 -122.873001098633 44.2541008 -121.1500015 0.611111 OR OR 1990\n",
" ⋮ │ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮\n",
" 3606799 │ STL TBN St. Louis, MO Fort Leonard Wood, MO 281 969 51 119 2009-02-01 2828990 46457 38.7486991882324 -90.370002746582 37.74160004 -92.14070129 0.00568607 MO MO 2009\n",
" 3606800 │ STL TBN St. Louis, MO Fort Leonard Wood, MO 245 1026 54 119 2009-11-01 2828990 46457 38.7486991882324 -90.370002746582 37.74160004 -92.14070129 0.00442206 MO MO 2009\n",
" 3606801 │ STL TBN St. Louis, MO Fort Leonard Wood, MO 363 1273 67 119 2009-08-01 2828990 46457 38.7486991882324 -90.370002746582 37.74160004 -92.14070129 0.00425602 MO MO 2009\n",
" 3606802 │ CGI TBN Cape Girardeau, MO Fort Leonard Wood, MO 2 19 1 146 2009-08-01 93712 46457 37.2252998352051 -89.57080078125 37.74160004 -92.14070129 0.105263 MO MO 2009\n",
" 3606803 │ FWA OH1 Fort Wayne, IN Washington Court House, OH 0 0 1 135 2003-09-01 398574 28133 40.97850037 -85.19509888 NA NA \u001b[90m missing \u001b[0m IN OH 2003\n",
"\u001b[31m 3606792 rows omitted\u001b[0m"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2 = transform(df,\n",
" [:Passengers, :Seats, :Flights] => ByRow(get_occupied) => :occupied,\n",
" [:Origin_city, :Destination_city] .=> ByRow(x -> last(x, 2)) .=> [:ost, :dst],\n",
" :Fly_date => ByRow(year)=> :year)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that in the computation we used `ByRow` wrapper that instructs DataFrames.jl to apply the function for each row of the passed data.\n",
"\n",
"Here is an alternative way to compute `:occupied` without using `ByRow`, but instead using standard broadcasting:"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"get_occupied2 (generic function with 1 method)"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"get_occupied2(passengers, seats, flights) =\n",
" @. ifelse((seats == 0) | (flights == 0), missing, passengers / (seats * flights))"
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>occupied</th></tr><tr><th></th><th>Float64?</th></tr></thead><tbody><p>3,606,803 rows × 1 columns</p><tr><th>1</th><td>0.7</td></tr><tr><th>2</th><td>0.00470615</td></tr><tr><th>3</th><td>0.0135426</td></tr><tr><th>4</th><td>0.0381944</td></tr><tr><th>5</th><td>0.0</td></tr><tr><th>6</th><td>0.611111</td></tr><tr><th>7</th><td>0.00694444</td></tr><tr><th>8</th><td>0.388889</td></tr><tr><th>9</th><td>0.0972222</td></tr><tr><th>10</th><td>0.444444</td></tr><tr><th>11</th><td>0.00629656</td></tr><tr><th>12</th><td>0.0144118</td></tr><tr><th>13</th><td>0.0113788</td></tr><tr><th>14</th><td>0.611111</td></tr><tr><th>15</th><td>0.0178307</td></tr><tr><th>16</th><td>0.00294913</td></tr><tr><th>17</th><td>0.0133333</td></tr><tr><th>18</th><td>0.00319609</td></tr><tr><th>19</th><td>0.0212754</td></tr><tr><th>20</th><td>0.00365201</td></tr><tr><th>&vellip;</th><td>&vellip;</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|c}\n",
"\t& occupied\\\\\n",
"\t\\hline\n",
"\t& Float64?\\\\\n",
"\t\\hline\n",
"\t1 & 0.7 \\\\\n",
"\t2 & 0.00470615 \\\\\n",
"\t3 & 0.0135426 \\\\\n",
"\t4 & 0.0381944 \\\\\n",
"\t5 & 0.0 \\\\\n",
"\t6 & 0.611111 \\\\\n",
"\t7 & 0.00694444 \\\\\n",
"\t8 & 0.388889 \\\\\n",
"\t9 & 0.0972222 \\\\\n",
"\t10 & 0.444444 \\\\\n",
"\t11 & 0.00629656 \\\\\n",
"\t12 & 0.0144118 \\\\\n",
"\t13 & 0.0113788 \\\\\n",
"\t14 & 0.611111 \\\\\n",
"\t15 & 0.0178307 \\\\\n",
"\t16 & 0.00294913 \\\\\n",
"\t17 & 0.0133333 \\\\\n",
"\t18 & 0.00319609 \\\\\n",
"\t19 & 0.0212754 \\\\\n",
"\t20 & 0.00365201 \\\\\n",
"\t$\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m3606803×1 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m occupied \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m Float64? \u001b[0m\n",
"─────────┼──────────────────\n",
" 1 │ 0.7\n",
" 2 │ 0.00470615\n",
" 3 │ 0.0135426\n",
" 4 │ 0.0381944\n",
" 5 │ 0.0\n",
" 6 │ 0.611111\n",
" ⋮ │ ⋮\n",
" 3606799 │ 0.00568607\n",
" 3606800 │ 0.00442206\n",
" 3606801 │ 0.00425602\n",
" 3606802 │ 0.105263\n",
" 3606803 │\u001b[90m missing \u001b[0m\n",
"\u001b[31m 3606792 rows omitted\u001b[0m"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df2′ = select(df, [:Passengers, :Seats, :Flights] => get_occupied2 => :occupied)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"First we check if both methods produced the same result:"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"true"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"isequal(df2.occupied, df2′.occupied)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The second thing we can do is compare the performance of both options:"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"BenchmarkTools.Trial: \n",
" memory estimate: 58.48 MiB\n",
" allocs estimate: 97\n",
" --------------\n",
" minimum time: 9.587 ms (0.00% GC)\n",
" median time: 10.809 ms (0.00% GC)\n",
" mean time: 11.749 ms (1.08% GC)\n",
" maximum time: 24.712 ms (0.00% GC)\n",
" --------------\n",
" samples: 426\n",
" evals/sample: 1"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@benchmark select($df, [:Passengers, :Seats, :Flights] => ByRow(get_occupied) => :occupied)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"BenchmarkTools.Trial: \n",
" memory estimate: 58.48 MiB\n",
" allocs estimate: 94\n",
" --------------\n",
" minimum time: 11.247 ms (0.00% GC)\n",
" median time: 13.610 ms (0.00% GC)\n",
" mean time: 15.025 ms (1.57% GC)\n",
" maximum time: 34.100 ms (7.50% GC)\n",
" --------------\n",
" samples: 334\n",
" evals/sample: 1"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@benchmark select($df, [:Passengers, :Seats, :Flights] => get_occupied2 => :occupied)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As you can see DataFrames.jl does a decent job in this case - the option with `ByRow` is a tad faster than the broadcasting approach."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A crucial value of piping with `@pipe` is that it composes also with functions outside of DataFrames.jl package.\n",
"\n",
"Here is a simple example in which we will plot the total number of passengers that flew by year:"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
"image/svg+xml": [
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
"<defs>\n",
" <clipPath id=\"clip970\">\n",
" <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<path clip-path=\"url(#clip970)\" d=\"\n",
"M0 1600 L2400 1600 L2400 0 L0 0 Z\n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip971\">\n",
" <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<path clip-path=\"url(#clip970)\" d=\"\n",
"M229.473 1423.18 L2352.76 1423.18 L2352.76 47.2441 L229.473 47.2441 Z\n",
" \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
"<defs>\n",
" <clipPath id=\"clip972\">\n",
" <rect x=\"229\" y=\"47\" width=\"2124\" height=\"1377\"/>\n",
" </clipPath>\n",
"</defs>\n",
"<polyline clip-path=\"url(#clip972)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 289.566,1423.18 289.566,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip972)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 816.697,1423.18 816.697,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip972)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1343.83,1423.18 1343.83,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip972)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 1870.96,1423.18 1870.96,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 229.473,1423.18 2352.76,1423.18 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 289.566,1423.18 289.566,1406.67 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 816.697,1423.18 816.697,1406.67 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1343.83,1423.18 1343.83,1406.67 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 1870.96,1423.18 1870.96,1406.67 \n",
" \"/>\n",
"<path clip-path=\"url(#clip970)\" d=\"M 0 0 M239.612 1479.92 L247.251 1479.92 L247.251 1453.55 L238.941 1455.22 L238.941 1450.96 L247.205 1449.29 L251.881 1449.29 L251.881 1479.92 L259.519 1479.92 L259.519 1483.85 L239.612 1483.85 L239.612 1479.92 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M264.728 1483.13 L264.728 1478.88 Q266.487 1479.71 268.293 1480.15 Q270.098 1480.59 271.834 1480.59 Q276.464 1480.59 278.894 1477.49 Q281.348 1474.36 281.695 1468.02 Q280.353 1470.01 278.293 1471.07 Q276.232 1472.14 273.732 1472.14 Q268.547 1472.14 265.515 1469.01 Q262.506 1465.87 262.506 1460.43 Q262.506 1455.1 265.654 1451.88 Q268.802 1448.67 274.033 1448.67 Q280.029 1448.67 283.177 1453.27 Q286.348 1457.86 286.348 1466.61 Q286.348 1474.78 282.459 1479.66 Q278.593 1484.52 272.043 1484.52 Q270.283 1484.52 268.478 1484.18 Q266.672 1483.83 264.728 1483.13 M274.033 1468.48 Q277.181 1468.48 279.01 1466.33 Q280.862 1464.18 280.862 1460.43 Q280.862 1456.7 279.01 1454.55 Q277.181 1452.37 274.033 1452.37 Q270.885 1452.37 269.033 1454.55 Q267.205 1456.7 267.205 1460.43 Q267.205 1464.18 269.033 1466.33 Q270.885 1468.48 274.033 1468.48 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M291.556 1483.13 L291.556 1478.88 Q293.316 1479.71 295.121 1480.15 Q296.927 1480.59 298.663 1480.59 Q303.292 1480.59 305.723 1477.49 Q308.177 1474.36 308.524 1468.02 Q307.181 1470.01 305.121 1471.07 Q303.061 1472.14 300.561 1472.14 Q295.376 1472.14 292.343 1469.01 Q289.334 1465.87 289.334 1460.43 Q289.334 1455.1 292.482 1451.88 Q295.63 1448.67 300.862 1448.67 Q306.857 1448.67 310.005 1453.27 Q313.177 1457.86 313.177 1466.61 Q313.177 1474.78 309.288 1479.66 Q305.422 1484.52 298.871 1484.52 Q297.112 1484.52 295.306 1484.18 Q293.501 1483.83 291.556 1483.13 M300.862 1468.48 Q304.01 1468.48 305.839 1466.33 Q307.691 1464.18 307.691 1460.43 Q307.691 1456.7 305.839 1454.55 Q304.01 1452.37 300.862 1452.37 Q297.714 1452.37 295.862 1454.55 Q294.033 1456.7 294.033 1460.43 Q294.033 1464.18 295.862 1466.33 Q297.714 1468.48 300.862 1468.48 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M328.246 1452.37 Q324.635 1452.37 322.806 1455.94 Q321.001 1459.48 321.001 1466.61 Q321.001 1473.71 322.806 1477.28 Q324.635 1480.82 328.246 1480.82 Q331.88 1480.82 333.686 1477.28 Q335.514 1473.71 335.514 1466.61 Q335.514 1459.48 333.686 1455.94 Q331.88 1452.37 328.246 1452.37 M328.246 1448.67 Q334.056 1448.67 337.112 1453.27 Q340.19 1457.86 340.19 1466.61 Q340.19 1475.33 337.112 1479.94 Q334.056 1484.52 328.246 1484.52 Q322.436 1484.52 319.357 1479.94 Q316.302 1475.33 316.302 1466.61 Q316.302 1457.86 319.357 1453.27 Q322.436 1448.67 328.246 1448.67 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M767.241 1479.92 L774.88 1479.92 L774.88 1453.55 L766.569 1455.22 L766.569 1450.96 L774.833 1449.29 L779.509 1449.29 L779.509 1479.92 L787.148 1479.92 L787.148 1483.85 L767.241 1483.85 L767.241 1479.92 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M792.356 1483.13 L792.356 1478.88 Q794.116 1479.71 795.921 1480.15 Q797.727 1480.59 799.463 1480.59 Q804.092 1480.59 806.523 1477.49 Q808.977 1474.36 809.324 1468.02 Q807.981 1470.01 805.921 1471.07 Q803.861 1472.14 801.361 1472.14 Q796.176 1472.14 793.143 1469.01 Q790.134 1465.87 790.134 1460.43 Q790.134 1455.1 793.282 1451.88 Q796.43 1448.67 801.662 1448.67 Q807.657 1448.67 810.805 1453.27 Q813.977 1457.86 813.977 1466.61 Q813.977 1474.78 810.088 1479.66 Q806.222 1484.52 799.671 1484.52 Q797.912 1484.52 796.106 1484.18 Q794.301 1483.83 792.356 1483.13 M801.662 1468.48 Q804.81 1468.48 806.639 1466.33 Q808.491 1464.18 808.491 1460.43 Q808.491 1456.7 806.639 1454.55 Q804.81 1452.37 801.662 1452.37 Q798.514 1452.37 796.662 1454.55 Q794.833 1456.7 794.833 1460.43 Q794.833 1464.18 796.662 1466.33 Q798.514 1468.48 801.662 1468.48 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M819.185 1483.13 L819.185 1478.88 Q820.944 1479.71 822.75 1480.15 Q824.555 1480.59 826.291 1480.59 Q830.921 1480.59 833.352 1477.49 Q835.805 1474.36 836.152 1468.02 Q834.81 1470.01 832.75 1471.07 Q830.689 1472.14 828.189 1472.14 Q823.004 1472.14 819.972 1469.01 Q816.963 1465.87 816.963 1460.43 Q816.963 1455.1 820.111 1451.88 Q823.259 1448.67 828.49 1448.67 Q834.486 1448.67 837.634 1453.27 Q840.805 1457.86 840.805 1466.61 Q840.805 1474.78 836.916 1479.66 Q833.051 1484.52 826.5 1484.52 Q824.74 1484.52 822.935 1484.18 Q821.129 1483.83 819.185 1483.13 M828.49 1468.48 Q831.639 1468.48 833.467 1466.33 Q835.319 1464.18 835.319 1460.43 Q835.319 1456.7 833.467 1454.55 Q831.639 1452.37 828.49 1452.37 Q825.342 1452.37 823.49 1454.55 Q821.662 1456.7 821.662 1460.43 Q821.662 1464.18 823.49 1466.33 Q825.342 1468.48 828.49 1468.48 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M845.921 1449.29 L864.277 1449.29 L864.277 1453.23 L850.203 1453.23 L850.203 1461.7 Q851.222 1461.35 852.24 1461.19 Q853.259 1461 854.277 1461 Q860.064 1461 863.444 1464.18 Q866.824 1467.35 866.824 1472.76 Q866.824 1478.34 863.351 1481.44 Q859.879 1484.52 853.56 1484.52 Q851.384 1484.52 849.115 1484.15 Q846.87 1483.78 844.463 1483.04 L844.463 1478.34 Q846.546 1479.48 848.768 1480.03 Q850.99 1480.59 853.467 1480.59 Q857.472 1480.59 859.81 1478.48 Q862.148 1476.38 862.148 1472.76 Q862.148 1469.15 859.81 1467.05 Q857.472 1464.94 853.467 1464.94 Q851.592 1464.94 849.717 1465.36 Q847.865 1465.77 845.921 1466.65 L845.921 1449.29 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1297.96 1479.92 L1314.28 1479.92 L1314.28 1483.85 L1292.33 1483.85 L1292.33 1479.92 Q1295 1477.16 1299.58 1472.53 Q1304.19 1467.88 1305.37 1466.54 Q1307.61 1464.01 1308.49 1462.28 Q1309.39 1460.52 1309.39 1458.83 Q1309.39 1456.07 1307.45 1454.34 Q1305.53 1452.6 1302.43 1452.6 Q1300.23 1452.6 1297.77 1453.37 Q1295.34 1454.13 1292.57 1455.68 L1292.57 1450.96 Q1295.39 1449.82 1297.84 1449.25 Q1300.3 1448.67 1302.33 1448.67 Q1307.7 1448.67 1310.9 1451.35 Q1314.09 1454.04 1314.09 1458.53 Q1314.09 1460.66 1313.28 1462.58 Q1312.5 1464.48 1310.39 1467.07 Q1309.81 1467.74 1306.71 1470.96 Q1303.61 1474.15 1297.96 1479.92 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1329.35 1452.37 Q1325.74 1452.37 1323.91 1455.94 Q1322.1 1459.48 1322.1 1466.61 Q1322.1 1473.71 1323.91 1477.28 Q1325.74 1480.82 1329.35 1480.82 Q1332.98 1480.82 1334.79 1477.28 Q1336.62 1473.71 1336.62 1466.61 Q1336.62 1459.48 1334.79 1455.94 Q1332.98 1452.37 1329.35 1452.37 M1329.35 1448.67 Q1335.16 1448.67 1338.21 1453.27 Q1341.29 1457.86 1341.29 1466.61 Q1341.29 1475.33 1338.21 1479.94 Q1335.16 1484.52 1329.35 1484.52 Q1323.54 1484.52 1320.46 1479.94 Q1317.4 1475.33 1317.4 1466.61 Q1317.4 1457.86 1320.46 1453.27 Q1323.54 1448.67 1329.35 1448.67 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1356.36 1452.37 Q1352.75 1452.37 1350.92 1455.94 Q1349.12 1459.48 1349.12 1466.61 Q1349.12 1473.71 1350.92 1477.28 Q1352.75 1480.82 1356.36 1480.82 Q1360 1480.82 1361.8 1477.28 Q1363.63 1473.71 1363.63 1466.61 Q1363.63 1459.48 1361.8 1455.94 Q1360 1452.37 1356.36 1452.37 M1356.36 1448.67 Q1362.17 1448.67 1365.23 1453.27 Q1368.31 1457.86 1368.31 1466.61 Q1368.31 1475.33 1365.23 1479.94 Q1362.17 1484.52 1356.36 1484.52 Q1350.55 1484.52 1347.47 1479.94 Q1344.42 1475.33 1344.42 1466.61 Q1344.42 1457.86 1347.47 1453.27 Q1350.55 1448.67 1356.36 1448.67 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1383.38 1452.37 Q1379.76 1452.37 1377.94 1455.94 Q1376.13 1459.48 1376.13 1466.61 Q1376.13 1473.71 1377.94 1477.28 Q1379.76 1480.82 1383.38 1480.82 Q1387.01 1480.82 1388.82 1477.28 Q1390.64 1473.71 1390.64 1466.61 Q1390.64 1459.48 1388.82 1455.94 Q1387.01 1452.37 1383.38 1452.37 M1383.38 1448.67 Q1389.19 1448.67 1392.24 1453.27 Q1395.32 1457.86 1395.32 1466.61 Q1395.32 1475.33 1392.24 1479.94 Q1389.19 1484.52 1383.38 1484.52 Q1377.57 1484.52 1374.49 1479.94 Q1371.43 1475.33 1371.43 1466.61 Q1371.43 1457.86 1374.49 1453.27 Q1377.57 1448.67 1383.38 1448.67 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1825.59 1479.92 L1841.91 1479.92 L1841.91 1483.85 L1819.96 1483.85 L1819.96 1479.92 Q1822.63 1477.16 1827.21 1472.53 Q1831.81 1467.88 1833 1466.54 Q1835.24 1464.01 1836.12 1462.28 Q1837.02 1460.52 1837.02 1458.83 Q1837.02 1456.07 1835.08 1454.34 Q1833.16 1452.6 1830.06 1452.6 Q1827.86 1452.6 1825.4 1453.37 Q1822.97 1454.13 1820.19 1455.68 L1820.19 1450.96 Q1823.02 1449.82 1825.47 1449.25 Q1827.93 1448.67 1829.96 1448.67 Q1835.33 1448.67 1838.53 1451.35 Q1841.72 1454.04 1841.72 1458.53 Q1841.72 1460.66 1840.91 1462.58 Q1840.13 1464.48 1838.02 1467.07 Q1837.44 1467.74 1834.34 1470.96 Q1831.24 1474.15 1825.59 1479.92 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1856.98 1452.37 Q1853.37 1452.37 1851.54 1455.94 Q1849.73 1459.48 1849.73 1466.61 Q1849.73 1473.71 1851.54 1477.28 Q1853.37 1480.82 1856.98 1480.82 Q1860.61 1480.82 1862.42 1477.28 Q1864.25 1473.71 1864.25 1466.61 Q1864.25 1459.48 1862.42 1455.94 Q1860.61 1452.37 1856.98 1452.37 M1856.98 1448.67 Q1862.79 1448.67 1865.84 1453.27 Q1868.92 1457.86 1868.92 1466.61 Q1868.92 1475.33 1865.84 1479.94 Q1862.79 1484.52 1856.98 1484.52 Q1851.17 1484.52 1848.09 1479.94 Q1845.03 1475.33 1845.03 1466.61 Q1845.03 1457.86 1848.09 1453.27 Q1851.17 1448.67 1856.98 1448.67 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1883.99 1452.37 Q1880.38 1452.37 1878.55 1455.94 Q1876.75 1459.48 1876.75 1466.61 Q1876.75 1473.71 1878.55 1477.28 Q1880.38 1480.82 1883.99 1480.82 Q1887.62 1480.82 1889.43 1477.28 Q1891.26 1473.71 1891.26 1466.61 Q1891.26 1459.48 1889.43 1455.94 Q1887.62 1452.37 1883.99 1452.37 M1883.99 1448.67 Q1889.8 1448.67 1892.86 1453.27 Q1895.93 1457.86 1895.93 1466.61 Q1895.93 1475.33 1892.86 1479.94 Q1889.8 1484.52 1883.99 1484.52 Q1878.18 1484.52 1875.1 1479.94 Q1872.05 1475.33 1872.05 1466.61 Q1872.05 1457.86 1875.1 1453.27 Q1878.18 1448.67 1883.99 1448.67 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1901.05 1449.29 L1919.41 1449.29 L1919.41 1453.23 L1905.33 1453.23 L1905.33 1461.7 Q1906.35 1461.35 1907.37 1461.19 Q1908.39 1461 1909.41 1461 Q1915.19 1461 1918.57 1464.18 Q1921.95 1467.35 1921.95 1472.76 Q1921.95 1478.34 1918.48 1481.44 Q1915.01 1484.52 1908.69 1484.52 Q1906.51 1484.52 1904.25 1484.15 Q1902 1483.78 1899.59 1483.04 L1899.59 1478.34 Q1901.68 1479.48 1903.9 1480.03 Q1906.12 1480.59 1908.6 1480.59 Q1912.6 1480.59 1914.94 1478.48 Q1917.28 1476.38 1917.28 1472.76 Q1917.28 1469.15 1914.94 1467.05 Q1912.6 1464.94 1908.6 1464.94 Q1906.72 1464.94 1904.85 1465.36 Q1903 1465.77 1901.05 1466.65 L1901.05 1449.29 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1244.07 1559.35 Q1241.59 1565.72 1239.23 1567.66 Q1236.88 1569.6 1232.93 1569.6 L1228.25 1569.6 L1228.25 1564.7 L1231.69 1564.7 Q1234.11 1564.7 1235.45 1563.56 Q1236.78 1562.41 1238.41 1558.14 L1239.46 1555.47 L1225.04 1520.4 L1231.24 1520.4 L1242.38 1548.28 L1253.52 1520.4 L1259.73 1520.4 L1244.07 1559.35 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1296.37 1536.76 L1296.37 1539.62 L1269.44 1539.62 Q1269.82 1545.67 1273.07 1548.85 Q1276.35 1552 1282.17 1552 Q1285.54 1552 1288.7 1551.17 Q1291.88 1550.35 1295 1548.69 L1295 1554.23 Q1291.85 1555.57 1288.54 1556.27 Q1285.23 1556.97 1281.82 1556.97 Q1273.29 1556.97 1268.29 1552 Q1263.33 1547.04 1263.33 1538.57 Q1263.33 1529.82 1268.04 1524.69 Q1272.78 1519.54 1280.8 1519.54 Q1288 1519.54 1292.16 1524.18 Q1296.37 1528.8 1296.37 1536.76 M1290.51 1535.04 Q1290.45 1530.23 1287.8 1527.37 Q1285.19 1524.5 1280.87 1524.5 Q1275.96 1524.5 1273 1527.27 Q1270.08 1530.04 1269.63 1535.07 L1290.51 1535.04 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1318.71 1538.12 Q1311.61 1538.12 1308.87 1539.75 Q1306.14 1541.37 1306.14 1545.29 Q1306.14 1548.4 1308.17 1550.25 Q1310.24 1552.07 1313.78 1552.07 Q1318.65 1552.07 1321.57 1548.63 Q1324.53 1545.16 1324.53 1539.43 L1324.53 1538.12 L1318.71 1538.12 M1330.39 1535.71 L1330.39 1556.04 L1324.53 1556.04 L1324.53 1550.63 Q1322.53 1553.88 1319.54 1555.44 Q1316.55 1556.97 1312.22 1556.97 Q1306.74 1556.97 1303.5 1553.91 Q1300.28 1550.82 1300.28 1545.67 Q1300.28 1539.65 1304.29 1536.6 Q1308.33 1533.54 1316.32 1533.54 L1324.53 1533.54 L1324.53 1532.97 Q1324.53 1528.93 1321.86 1526.73 Q1319.22 1524.5 1314.41 1524.5 Q1311.36 1524.5 1308.46 1525.23 Q1305.56 1525.97 1302.89 1527.43 L1302.89 1522.02 Q1306.11 1520.78 1309.13 1520.17 Q1312.15 1519.54 1315.02 1519.54 Q1322.75 1519.54 1326.57 1523.55 Q1330.39 1527.56 1330.39 1535.71 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M1357.19 1525.87 Q1356.2 1525.3 1355.03 1525.04 Q1353.88 1524.76 1352.48 1524.76 Q1347.51 1524.76 1344.84 1528 Q1342.2 1531.22 1342.2 1537.27 L1342.2 1556.04 L1336.31 1556.04 L1336.31 1520.4 L1342.2 1520.4 L1342.2 1525.93 Q1344.05 1522.69 1347.01 1521.13 Q1349.97 1519.54 1354.2 1519.54 Q1354.8 1519.54 1355.54 1519.63 Q1356.27 1519.7 1357.16 1519.85 L1357.19 1525.87 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><polyline clip-path=\"url(#clip972)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 229.473,1180.83 2352.76,1180.83 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip972)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 229.473,875.502 2352.76,875.502 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip972)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 229.473,570.175 2352.76,570.175 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip972)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
" 229.473,264.848 2352.76,264.848 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 229.473,1423.18 229.473,47.2441 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 229.473,1180.83 254.952,1180.83 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 229.473,875.502 254.952,875.502 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 229.473,570.175 254.952,570.175 \n",
" \"/>\n",
"<polyline clip-path=\"url(#clip970)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 229.473,264.848 254.952,264.848 \n",
" \"/>\n",
"<path clip-path=\"url(#clip970)\" d=\"M 0 0 M129.862 1167.62 L118.056 1186.07 L129.862 1186.07 L129.862 1167.62 M128.635 1163.55 L134.515 1163.55 L134.515 1186.07 L139.445 1186.07 L139.445 1189.96 L134.515 1189.96 L134.515 1198.11 L129.862 1198.11 L129.862 1189.96 L114.26 1189.96 L114.26 1185.45 L128.635 1163.55 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M154.515 1166.63 Q150.903 1166.63 149.075 1170.19 Q147.269 1173.73 147.269 1180.86 Q147.269 1187.97 149.075 1191.53 Q150.903 1195.08 154.515 1195.08 Q158.149 1195.08 159.954 1191.53 Q161.783 1187.97 161.783 1180.86 Q161.783 1173.73 159.954 1170.19 Q158.149 1166.63 154.515 1166.63 M154.515 1162.92 Q160.325 1162.92 163.38 1167.53 Q166.459 1172.11 166.459 1180.86 Q166.459 1189.59 163.38 1194.2 Q160.325 1198.78 154.515 1198.78 Q148.704 1198.78 145.626 1194.2 Q142.57 1189.59 142.57 1180.86 Q142.57 1172.11 145.626 1167.53 Q148.704 1162.92 154.515 1162.92 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M181.528 1166.63 Q177.917 1166.63 176.089 1170.19 Q174.283 1173.73 174.283 1180.86 Q174.283 1187.97 176.089 1191.53 Q177.917 1195.08 181.528 1195.08 Q185.163 1195.08 186.968 1191.53 Q188.797 1187.97 188.797 1180.86 Q188.797 1173.73 186.968 1170.19 Q185.163 1166.63 181.528 1166.63 M181.528 1162.92 Q187.338 1162.92 190.394 1167.53 Q193.473 1172.11 193.473 1180.86 Q193.473 1189.59 190.394 1194.2 Q187.338 1198.78 181.528 1198.78 Q175.718 1198.78 172.639 1194.2 Q169.584 1189.59 169.584 1180.86 Q169.584 1172.11 172.639 1167.53 Q175.718 1162.92 181.528 1162.92 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M130.857 862.296 L119.052 880.745 L130.857 880.745 L130.857 862.296 M129.63 858.222 L135.51 858.222 L135.51 880.745 L140.441 880.745 L140.441 884.634 L135.51 884.634 L135.51 892.782 L130.857 892.782 L130.857 884.634 L115.256 884.634 L115.256 880.12 L129.63 858.222 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M145.556 858.222 L163.913 858.222 L163.913 862.157 L149.839 862.157 L149.839 870.629 Q150.857 870.282 151.876 870.12 Q152.894 869.935 153.913 869.935 Q159.7 869.935 163.079 873.106 Q166.459 876.277 166.459 881.694 Q166.459 887.273 162.987 890.375 Q159.515 893.453 153.195 893.453 Q151.019 893.453 148.751 893.083 Q146.505 892.712 144.098 891.972 L144.098 887.273 Q146.181 888.407 148.403 888.962 Q150.626 889.518 153.103 889.518 Q157.107 889.518 159.445 887.412 Q161.783 885.305 161.783 881.694 Q161.783 878.083 159.445 875.976 Q157.107 873.87 153.103 873.87 Q151.228 873.87 149.353 874.287 Q147.501 874.703 145.556 875.583 L145.556 858.222 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M181.528 861.301 Q177.917 861.301 176.089 864.865 Q174.283 868.407 174.283 875.537 Q174.283 882.643 176.089 886.208 Q177.917 889.75 181.528 889.75 Q185.163 889.75 186.968 886.208 Q188.797 882.643 188.797 875.537 Q188.797 868.407 186.968 864.865 Q185.163 861.301 181.528 861.301 M181.528 857.597 Q187.338 857.597 190.394 862.203 Q193.473 866.787 193.473 875.537 Q193.473 884.263 190.394 888.87 Q187.338 893.453 181.528 893.453 Q175.718 893.453 172.639 888.87 Q169.584 884.263 169.584 875.537 Q169.584 866.787 172.639 862.203 Q175.718 857.597 181.528 857.597 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M118.543 552.895 L136.899 552.895 L136.899 556.83 L122.825 556.83 L122.825 565.302 Q123.843 564.955 124.862 564.793 Q125.88 564.608 126.899 564.608 Q132.686 564.608 136.066 567.779 Q139.445 570.95 139.445 576.367 Q139.445 581.946 135.973 585.047 Q132.501 588.126 126.181 588.126 Q124.005 588.126 121.737 587.756 Q119.492 587.385 117.084 586.645 L117.084 581.946 Q119.168 583.08 121.39 583.635 Q123.612 584.191 126.089 584.191 Q130.093 584.191 132.431 582.084 Q134.769 579.978 134.769 576.367 Q134.769 572.756 132.431 570.649 Q130.093 568.543 126.089 568.543 Q124.214 568.543 122.339 568.96 Q120.487 569.376 118.543 570.256 L118.543 552.895 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M154.515 555.974 Q150.903 555.974 149.075 559.538 Q147.269 563.08 147.269 570.21 Q147.269 577.316 149.075 580.881 Q150.903 584.422 154.515 584.422 Q158.149 584.422 159.954 580.881 Q161.783 577.316 161.783 570.21 Q161.783 563.08 159.954 559.538 Q158.149 555.974 154.515 555.974 M154.515 552.27 Q160.325 552.27 163.38 556.876 Q166.459 561.46 166.459 570.21 Q166.459 578.936 163.38 583.543 Q160.325 588.126 154.515 588.126 Q148.704 588.126 145.626 583.543 Q142.57 578.936 142.57 570.21 Q142.57 561.46 145.626 556.876 Q148.704 552.27 154.515 552.27 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M181.528 555.974 Q177.917 555.974 176.089 559.538 Q174.283 563.08 174.283 570.21 Q174.283 577.316 176.089 580.881 Q177.917 584.422 181.528 584.422 Q185.163 584.422 186.968 580.881 Q188.797 577.316 188.797 570.21 Q188.797 563.08 186.968 559.538 Q185.163 555.974 181.528 555.974 M181.528 552.27 Q187.338 552.27 190.394 556.876 Q193.473 561.46 193.473 570.21 Q193.473 578.936 190.394 583.543 Q187.338 588.126 181.528 588.126 Q175.718 588.126 172.639 583.543 Q169.584 578.936 169.584 570.21 Q169.584 561.46 172.639 556.876 Q175.718 552.27 181.528 552.27 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M119.538 247.568 L137.894 247.568 L137.894 251.503 L123.82 251.503 L123.82 259.975 Q124.839 259.628 125.857 259.466 Q126.876 259.281 127.894 259.281 Q133.681 259.281 137.061 262.452 Q140.441 265.623 140.441 271.04 Q140.441 276.618 136.968 279.72 Q133.496 282.799 127.177 282.799 Q125.001 282.799 122.732 282.429 Q120.487 282.058 118.08 281.318 L118.08 276.618 Q120.163 277.753 122.385 278.308 Q124.607 278.864 127.084 278.864 Q131.089 278.864 133.427 276.757 Q135.765 274.651 135.765 271.04 Q135.765 267.429 133.427 265.322 Q131.089 263.216 127.084 263.216 Q125.209 263.216 123.334 263.632 Q121.482 264.049 119.538 264.929 L119.538 247.568 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M145.556 247.568 L163.913 247.568 L163.913 251.503 L149.839 251.503 L149.839 259.975 Q150.857 259.628 151.876 259.466 Q152.894 259.281 153.913 259.281 Q159.7 259.281 163.079 262.452 Q166.459 265.623 166.459 271.04 Q166.459 276.618 162.987 279.72 Q159.515 282.799 153.195 282.799 Q151.019 282.799 148.751 282.429 Q146.505 282.058 144.098 281.318 L144.098 276.618 Q146.181 277.753 148.403 278.308 Q150.626 278.864 153.103 278.864 Q157.107 278.864 159.445 276.757 Q161.783 274.651 161.783 271.04 Q161.783 267.429 159.445 265.322 Q157.107 263.216 153.103 263.216 Q151.228 263.216 149.353 263.632 Q147.501 264.049 145.556 264.929 L145.556 247.568 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M181.528 250.646 Q177.917 250.646 176.089 254.211 Q174.283 257.753 174.283 264.882 Q174.283 271.989 176.089 275.554 Q177.917 279.095 181.528 279.095 Q185.163 279.095 186.968 275.554 Q188.797 271.989 188.797 264.882 Q188.797 257.753 186.968 254.211 Q185.163 250.646 181.528 250.646 M181.528 246.943 Q187.338 246.943 190.394 251.549 Q193.473 256.132 193.473 264.882 Q193.473 273.609 190.394 278.216 Q187.338 282.799 181.528 282.799 Q175.718 282.799 172.639 278.216 Q169.584 273.609 169.584 264.882 Q169.584 256.132 172.639 251.549 Q175.718 246.943 181.528 246.943 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M82.657 1063.14 L101.563 1063.14 L101.563 1069.03 L52.3562 1069.03 L52.3562 1063.14 L57.7671 1063.14 Q54.5842 1061.3 53.0564 1058.49 Q51.4968 1055.66 51.4968 1051.75 Q51.4968 1045.25 56.6531 1041.21 Q61.8093 1037.14 70.212 1037.14 Q78.6147 1037.14 83.771 1041.21 Q88.9272 1045.25 88.9272 1051.75 Q88.9272 1055.66 87.3994 1058.49 Q85.8398 1061.3 82.657 1063.14 M70.212 1043.22 Q63.7508 1043.22 60.0905 1045.89 Q56.3984 1048.53 56.3984 1053.18 Q56.3984 1057.83 60.0905 1060.5 Q63.7508 1063.14 70.212 1063.14 Q76.6732 1063.14 80.3653 1060.5 Q84.0256 1057.83 84.0256 1053.18 Q84.0256 1048.53 80.3653 1045.89 Q76.6732 1043.22 70.212 1043.22 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M70.0847 1014.79 Q70.0847 1021.89 71.7079 1024.63 Q73.3312 1027.37 77.2461 1027.37 Q80.3653 1027.37 82.2114 1025.33 Q84.0256 1023.26 84.0256 1019.73 Q84.0256 1014.86 80.5881 1011.93 Q77.1188 1008.97 71.3897 1008.97 L70.0847 1008.97 L70.0847 1014.79 M67.6657 1003.11 L88.0042 1003.11 L88.0042 1008.97 L82.5933 1008.97 Q85.8398 1010.97 87.3994 1013.97 Q88.9272 1016.96 88.9272 1021.29 Q88.9272 1026.76 85.8716 1030.01 Q82.7843 1033.22 77.6281 1033.22 Q71.6125 1033.22 68.5569 1029.21 Q65.5014 1025.17 65.5014 1017.18 L65.5014 1008.97 L64.9285 1008.97 Q60.8862 1008.97 58.6901 1011.64 Q56.4621 1014.28 56.4621 1019.09 Q56.4621 1022.15 57.1941 1025.04 Q57.9262 1027.94 59.3903 1030.61 L53.9795 1030.61 Q52.7381 1027.4 52.1334 1024.37 Q51.4968 1021.35 51.4968 1018.49 Q51.4968 1010.75 55.5072 1006.93 Q59.5176 1003.11 67.6657 1003.11 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M53.4065 974.244 L58.9447 974.244 Q57.6716 976.727 57.035 979.4 Q56.3984 982.074 56.3984 984.939 Q56.3984 989.299 57.7352 991.495 Q59.072 993.66 61.7456 993.66 Q63.7826 993.66 64.9603 992.1 Q66.1061 990.54 67.1565 985.83 L67.6021 983.825 Q68.9389 977.586 71.3897 974.976 Q73.8086 972.335 78.1691 972.335 Q83.1344 972.335 86.0308 976.281 Q88.9272 980.196 88.9272 987.071 Q88.9272 989.936 88.3543 993.055 Q87.8132 996.142 86.6992 999.58 L80.6518 999.58 Q82.3387 996.333 83.198 993.182 Q84.0256 990.031 84.0256 986.944 Q84.0256 982.806 82.6251 980.578 Q81.1929 978.35 78.6147 978.35 Q76.2276 978.35 74.9545 979.973 Q73.6813 981.565 72.5037 987.007 L72.0262 989.045 Q70.8804 994.487 68.5251 996.906 Q66.138 999.325 62.0002 999.325 Q56.9713 999.325 54.2341 995.76 Q51.4968 992.196 51.4968 985.639 Q51.4968 982.392 51.9743 979.528 Q52.4517 976.663 53.4065 974.244 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M53.4065 943.466 L58.9447 943.466 Q57.6716 945.949 57.035 948.622 Q56.3984 951.296 56.3984 954.16 Q56.3984 958.521 57.7352 960.717 Q59.072 962.881 61.7456 962.881 Q63.7826 962.881 64.9603 961.322 Q66.1061 959.762 67.1565 955.052 L67.6021 953.046 Q68.9389 946.808 71.3897 944.198 Q73.8086 941.556 78.1691 941.556 Q83.1344 941.556 86.0308 945.503 Q88.9272 949.418 88.9272 956.293 Q88.9272 959.158 88.3543 962.277 Q87.8132 965.364 86.6992 968.802 L80.6518 968.802 Q82.3387 965.555 83.198 962.404 Q84.0256 959.253 84.0256 956.166 Q84.0256 952.028 82.6251 949.8 Q81.1929 947.572 78.6147 947.572 Q76.2276 947.572 74.9545 949.195 Q73.6813 950.787 72.5037 956.229 L72.0262 958.266 Q70.8804 963.709 68.5251 966.128 Q66.138 968.547 62.0002 968.547 Q56.9713 968.547 54.2341 964.982 Q51.4968 961.417 51.4968 954.861 Q51.4968 951.614 51.9743 948.75 Q52.4517 945.885 53.4065 943.466 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M68.7161 904.922 L71.5806 904.922 L71.5806 931.849 Q77.6281 931.467 80.8109 928.22 Q83.9619 924.942 83.9619 919.117 Q83.9619 915.743 83.1344 912.592 Q82.3069 909.41 80.6518 906.29 L86.1899 906.29 Q87.5267 909.441 88.227 912.752 Q88.9272 916.062 88.9272 919.467 Q88.9272 927.997 83.9619 932.994 Q78.9967 937.96 70.5303 937.96 Q61.7774 937.96 56.6531 933.249 Q51.4968 928.507 51.4968 920.486 Q51.4968 913.293 56.1438 909.123 Q60.7589 904.922 68.7161 904.922 M66.9973 910.778 Q62.1912 910.842 59.3266 913.484 Q56.4621 916.094 56.4621 920.422 Q56.4621 925.324 59.2312 928.284 Q62.0002 931.212 67.0292 931.658 L66.9973 910.778 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M66.4881 869.146 L88.0042 869.146 L88.0042 875.003 L66.679 875.003 Q61.6183 875.003 59.1038 876.976 Q56.5894 878.95 56.5894 882.896 Q56.5894 887.639 59.6131 890.376 Q62.6368 893.113 67.8567 893.113 L88.0042 893.113 L88.0042 899.002 L52.3562 899.002 L52.3562 893.113 L57.8944 893.113 Q54.6797 891.013 53.0883 888.18 Q51.4968 885.315 51.4968 881.591 Q51.4968 875.448 55.3163 872.297 Q59.1038 869.146 66.4881 869.146 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M69.7664 839.546 Q63.4007 839.546 59.8996 842.188 Q56.3984 844.798 56.3984 849.54 Q56.3984 854.251 59.8996 856.892 Q63.4007 859.502 69.7664 859.502 Q76.1003 859.502 79.6014 856.892 Q83.1026 854.251 83.1026 849.54 Q83.1026 844.798 79.6014 842.188 Q76.1003 839.546 69.7664 839.546 M83.58 833.689 Q92.683 833.689 97.1071 837.732 Q101.563 841.774 101.563 850.113 Q101.563 853.2 101.086 855.938 Q100.64 858.675 99.6852 861.253 L93.9879 861.253 Q95.3884 858.675 96.0568 856.16 Q96.7252 853.646 96.7252 851.036 Q96.7252 845.275 93.7015 842.41 Q90.7096 839.546 84.6303 839.546 L81.7339 839.546 Q84.885 841.36 86.4446 844.193 Q88.0042 847.026 88.0042 850.972 Q88.0042 857.529 83.0071 861.539 Q78.01 865.55 69.7664 865.55 Q61.491 865.55 56.4939 861.539 Q51.4968 857.529 51.4968 850.972 Q51.4968 847.026 53.0564 844.193 Q54.616 841.36 57.7671 839.546 L52.3562 839.546 L52.3562 833.689 L83.58 833.689 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M68.7161 797.055 L71.5806 797.055 L71.5806 823.982 Q77.6281 823.6 80.8109 820.353 Q83.9619 817.075 83.9619 811.25 Q83.9619 807.877 83.1344 804.725 Q82.3069 801.543 80.6518 798.423 L86.1899 798.423 Q87.5267 801.574 88.227 804.885 Q88.9272 808.195 88.9272 811.6 Q88.9272 820.13 83.9619 825.128 Q78.9967 830.093 70.5303 830.093 Q61.7774 830.093 56.6531 825.382 Q51.4968 820.64 51.4968 812.619 Q51.4968 805.426 56.1438 801.256 Q60.7589 797.055 68.7161 797.055 M66.9973 802.911 Q62.1912 802.975 59.3266 805.617 Q56.4621 808.227 56.4621 812.555 Q56.4621 817.457 59.2312 820.417 Q62.0002 823.345 67.0292 823.791 L66.9973 802.911 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M57.8307 770.255 Q57.2578 771.242 57.0032 772.42 Q56.7167 773.565 56.7167 774.966 Q56.7167 779.931 59.9632 782.605 Q63.1779 785.246 69.2253 785.246 L88.0042 785.246 L88.0042 791.135 L52.3562 791.135 L52.3562 785.246 L57.8944 785.246 Q54.6479 783.4 53.0883 780.44 Q51.4968 777.48 51.4968 773.247 Q51.4968 772.642 51.5923 771.91 Q51.656 771.178 51.8151 770.287 L57.8307 770.255 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M53.4065 741.387 L58.9447 741.387 Q57.6716 743.869 57.035 746.543 Q56.3984 749.217 56.3984 752.081 Q56.3984 756.442 57.7352 758.638 Q59.072 760.802 61.7456 760.802 Q63.7826 760.802 64.9603 759.243 Q66.1061 757.683 67.1565 752.972 L67.6021 750.967 Q68.9389 744.729 71.3897 742.119 Q73.8086 739.477 78.1691 739.477 Q83.1344 739.477 86.0308 743.424 Q88.9272 747.339 88.9272 754.214 Q88.9272 757.078 88.3543 760.197 Q87.8132 763.285 86.6992 766.722 L80.6518 766.722 Q82.3387 763.476 83.198 760.325 Q84.0256 757.174 84.0256 754.086 Q84.0256 749.949 82.6251 747.721 Q81.1929 745.493 78.6147 745.493 Q76.2276 745.493 74.9545 747.116 Q73.6813 748.707 72.5037 754.15 L72.0262 756.187 Q70.8804 761.63 68.5251 764.049 Q66.138 766.468 62.0002 766.468 Q56.9713 766.468 54.2341 762.903 Q51.4968 759.338 51.4968 752.781 Q51.4968 749.535 51.9743 746.67 Q52.4517 743.806 53.4065 741.387 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M38.5426 698.545 Q45.8632 702.811 53.0246 704.879 Q60.186 706.948 67.5384 706.948 Q74.8908 706.948 82.1159 704.879 Q89.3091 702.779 96.5979 698.545 L96.5979 703.638 Q89.1182 708.412 81.8931 710.799 Q74.668 713.155 67.5384 713.155 Q60.4406 713.155 53.2474 710.799 Q46.0542 708.444 38.5426 703.638 L38.5426 698.545 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M52.3562 692.403 L52.3562 686.546 L88.0042 686.546 L88.0042 692.403 L52.3562 692.403 M38.479 692.403 L38.479 686.546 L45.895 686.546 L45.895 692.403 L38.479 692.403 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M66.4881 650.771 L88.0042 650.771 L88.0042 656.627 L66.679 656.627 Q61.6183 656.627 59.1038 658.601 Q56.5894 660.574 56.5894 664.521 Q56.5894 669.263 59.6131 672.001 Q62.6368 674.738 67.8567 674.738 L88.0042 674.738 L88.0042 680.626 L52.3562 680.626 L52.3562 674.738 L57.8944 674.738 Q54.6797 672.637 53.0883 669.804 Q51.4968 666.94 51.4968 663.216 Q51.4968 657.073 55.3163 653.922 Q59.1038 650.771 66.4881 650.771 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M59.1993 596.153 Q55.2526 593.957 53.3747 590.901 Q51.4968 587.846 51.4968 583.708 Q51.4968 578.138 55.4117 575.114 Q59.2948 572.091 66.4881 572.091 L88.0042 572.091 L88.0042 577.979 L66.679 577.979 Q61.5546 577.979 59.072 579.793 Q56.5894 581.607 56.5894 585.331 Q56.5894 589.883 59.6131 592.525 Q62.6368 595.166 67.8567 595.166 L88.0042 595.166 L88.0042 601.055 L66.679 601.055 Q61.5228 601.055 59.072 602.869 Q56.5894 604.683 56.5894 608.471 Q56.5894 612.959 59.6449 615.6 Q62.6686 618.242 67.8567 618.242 L88.0042 618.242 L88.0042 624.13 L52.3562 624.13 L52.3562 618.242 L57.8944 618.242 Q54.616 616.237 53.0564 613.436 Q51.4968 610.635 51.4968 606.784 Q51.4968 602.901 53.4702 600.195 Q55.4436 597.458 59.1993 596.153 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M52.3562 565.948 L52.3562 560.091 L88.0042 560.091 L88.0042 565.948 L52.3562 565.948 M38.479 565.948 L38.479 560.091 L45.895 560.091 L45.895 565.948 L38.479 565.948 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M38.479 553.948 L38.479 548.092 L88.0042 548.092 L88.0042 553.948 L38.479 553.948 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M38.479 541.949 L38.479 536.093 L88.0042 536.093 L88.0042 541.949 L38.479 541.949 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M52.3562 529.95 L52.3562 524.093 L88.0042 524.093 L88.0042 529.95 L52.3562 529.95 M38.479 529.95 L38.479 524.093 L45.895 524.093 L45.895 529.95 L38.479 529.95 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M56.4621 504.137 Q56.4621 508.847 60.1542 511.585 Q63.8145 514.322 70.212 514.322 Q76.6095 514.322 80.3017 511.617 Q83.9619 508.879 83.9619 504.137 Q83.9619 499.458 80.2698 496.721 Q76.5777 493.984 70.212 493.984 Q63.8781 493.984 60.186 496.721 Q56.4621 499.458 56.4621 504.137 M51.4968 504.137 Q51.4968 496.498 56.4621 492.137 Q61.4273 487.777 70.212 487.777 Q78.9649 487.777 83.9619 492.137 Q88.9272 496.498 88.9272 504.137 Q88.9272 511.807 83.9619 516.168 Q78.9649 520.497 70.212 520.497 Q61.4273 520.497 56.4621 516.168 Q51.4968 511.807 51.4968 504.137 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M66.4881 452.002 L88.0042 452.002 L88.0042 457.858 L66.679 457.858 Q61.6183 457.858 59.1038 459.831 Q56.5894 461.805 56.5894 465.752 Q56.5894 470.494 59.6131 473.231 Q62.6368 475.969 67.8567 475.969 L88.0042 475.969 L88.0042 481.857 L52.3562 481.857 L52.3562 475.969 L57.8944 475.969 Q54.6797 473.868 53.0883 471.035 Q51.4968 468.171 51.4968 464.447 Q51.4968 458.304 55.3163 455.153 Q59.1038 452.002 66.4881 452.002 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M53.4065 423.133 L58.9447 423.133 Q57.6716 425.616 57.035 428.289 Q56.3984 430.963 56.3984 433.828 Q56.3984 438.188 57.7352 440.384 Q59.072 442.549 61.7456 442.549 Q63.7826 442.549 64.9603 440.989 Q66.1061 439.429 67.1565 434.719 L67.6021 432.714 Q68.9389 426.475 71.3897 423.865 Q73.8086 421.223 78.1691 421.223 Q83.1344 421.223 86.0308 425.17 Q88.9272 429.085 88.9272 435.96 Q88.9272 438.825 88.3543 441.944 Q87.8132 445.031 86.6992 448.469 L80.6518 448.469 Q82.3387 445.222 83.198 442.071 Q84.0256 438.92 84.0256 435.833 Q84.0256 431.695 82.6251 429.467 Q81.1929 427.239 78.6147 427.239 Q76.2276 427.239 74.9545 428.862 Q73.6813 430.454 72.5037 435.896 L72.0262 437.933 Q70.8804 443.376 68.5251 445.795 Q66.138 448.214 62.0002 448.214 Q56.9713 448.214 54.2341 444.649 Q51.4968 441.084 51.4968 434.528 Q51.4968 431.281 51.9743 428.417 Q52.4517 425.552 53.4065 423.133 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><path clip-path=\"url(#clip970)\" d=\"M 0 0 M38.5426 416.004 L38.5426 410.911 Q46.0542 406.137 53.2474 403.781 Q60.4406 401.394 67.5384 401.394 Q74.668 401.394 81.8931 403.781 Q89.1182 406.137 96.5979 410.911 L96.5979 416.004 Q89.3091 411.77 82.1159 409.702 Q74.8908 407.601 67.5384 407.601 Q60.186 407.601 53.0246 409.702 Q45.8632 411.77 38.5426 416.004 Z\" fill=\"#000000\" fill-rule=\"evenodd\" fill-opacity=\"1\" /><polyline clip-path=\"url(#clip972)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
" 289.566,1361.56 394.992,1384.24 500.418,1282.67 605.844,1235.2 711.27,1021.26 816.697,926.145 922.123,766.281 1027.55,680.523 1132.98,619.531 1238.4,500.933 \n",
" 1343.83,362.815 1449.25,588.435 1554.68,655.492 1660.11,515.283 1765.53,286.407 1870.96,153.664 1976.38,174.914 2081.81,86.1857 2187.24,234.323 2292.66,409.561 \n",
" \n",
" \"/>\n",
"</svg>\n"
]
},
"execution_count": 26,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@pipe df2 |>\n",
" groupby(_, :year, sort=true) |>\n",
" combine(_, :Passengers => sum) |>\n",
" plot(_.year, _.Passengers_sum ./ 10^6, legend=nothing,\n",
" xlab=\"year\", ylab=\"passengers (in millions)\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"I particular note that `_` notation from Pipe.jl package allows you to write any valid code you could use on the passed value. In our case `plot` is passed a `DataFrame`, so we e.g. write `_.year` to get a `:year` column from it."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the following example we will want to find pairs of origin-destination states that have the highest occupancy:"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>ost</th><th>dst</th><th>occupied</th><th>Passengers_sum</th></tr><tr><th></th><th>String</th><th>String</th><th>Float64</th><th>Int64</th></tr></thead><tbody><p>2,369 rows × 4 columns</p><tr><th>1</th><td>NE</td><td>AK</td><td>1.0</td><td>180</td></tr><tr><th>2</th><td>MD</td><td>ID</td><td>1.0</td><td>150</td></tr><tr><th>3</th><td>ID</td><td>AR</td><td>1.0</td><td>124</td></tr><tr><th>4</th><td>ID</td><td>MS</td><td>1.0</td><td>181</td></tr><tr><th>5</th><td>ND</td><td>RI</td><td>1.0</td><td>50</td></tr><tr><th>6</th><td>WY</td><td>NY</td><td>0.991935</td><td>123</td></tr><tr><th>7</th><td>OR</td><td>RI</td><td>0.991935</td><td>123</td></tr><tr><th>8</th><td>WV</td><td>NE</td><td>0.984615</td><td>176</td></tr><tr><th>9</th><td>KS</td><td>ID</td><td>0.983871</td><td>122</td></tr><tr><th>10</th><td>AK</td><td>TN</td><td>0.981723</td><td>376</td></tr><tr><th>11</th><td>NM</td><td>KY</td><td>0.979204</td><td>285</td></tr><tr><th>12</th><td>HI</td><td>NE</td><td>0.977472</td><td>1327</td></tr><tr><th>13</th><td>PA</td><td>HI</td><td>0.974296</td><td>699</td></tr><tr><th>14</th><td>SD</td><td>MS</td><td>0.971098</td><td>168</td></tr><tr><th>15</th><td>WV</td><td>NV</td><td>0.970803</td><td>133</td></tr><tr><th>16</th><td>MI</td><td>ID</td><td>0.966667</td><td>145</td></tr><tr><th>17</th><td>MS</td><td>SD</td><td>0.965318</td><td>167</td></tr><tr><th>18</th><td>MD</td><td>HI</td><td>0.963899</td><td>267</td></tr><tr><th>19</th><td>MT</td><td>OK</td><td>0.959677</td><td>164</td></tr><tr><th>20</th><td>OR</td><td>VA</td><td>0.955169</td><td>653</td></tr><tr><th>&vellip;</th><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cccc}\n",
"\t& ost & dst & occupied & Passengers\\_sum\\\\\n",
"\t\\hline\n",
"\t& String & String & Float64 & Int64\\\\\n",
"\t\\hline\n",
"\t1 & NE & AK & 1.0 & 180 \\\\\n",
"\t2 & MD & ID & 1.0 & 150 \\\\\n",
"\t3 & ID & AR & 1.0 & 124 \\\\\n",
"\t4 & ID & MS & 1.0 & 181 \\\\\n",
"\t5 & ND & RI & 1.0 & 50 \\\\\n",
"\t6 & WY & NY & 0.991935 & 123 \\\\\n",
"\t7 & OR & RI & 0.991935 & 123 \\\\\n",
"\t8 & WV & NE & 0.984615 & 176 \\\\\n",
"\t9 & KS & ID & 0.983871 & 122 \\\\\n",
"\t10 & AK & TN & 0.981723 & 376 \\\\\n",
"\t11 & NM & KY & 0.979204 & 285 \\\\\n",
"\t12 & HI & NE & 0.977472 & 1327 \\\\\n",
"\t13 & PA & HI & 0.974296 & 699 \\\\\n",
"\t14 & SD & MS & 0.971098 & 168 \\\\\n",
"\t15 & WV & NV & 0.970803 & 133 \\\\\n",
"\t16 & MI & ID & 0.966667 & 145 \\\\\n",
"\t17 & MS & SD & 0.965318 & 167 \\\\\n",
"\t18 & MD & HI & 0.963899 & 267 \\\\\n",
"\t19 & MT & OK & 0.959677 & 164 \\\\\n",
"\t20 & OR & VA & 0.955169 & 653 \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m2369×4 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m ost \u001b[0m\u001b[1m dst \u001b[0m\u001b[1m occupied \u001b[0m\u001b[1m Passengers_sum \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Float64 \u001b[0m\u001b[90m Int64 \u001b[0m\n",
"──────┼──────────────────────────────────────────\n",
" 1 │ NE AK 1.0 180\n",
" 2 │ MD ID 1.0 150\n",
" 3 │ ID AR 1.0 124\n",
" 4 │ ID MS 1.0 181\n",
" 5 │ ND RI 1.0 50\n",
" 6 │ WY NY 0.991935 123\n",
" ⋮ │ ⋮ ⋮ ⋮ ⋮\n",
" 2365 │ AK AR 0.0 0\n",
" 2366 │ DE MN 0.0 0\n",
" 2367 │ AL SD 0.0 0\n",
" 2368 │ SC SD 0.0 0\n",
" 2369 │ AK VA 0.0 0\n",
"\u001b[31m 2358 rows omitted\u001b[0m"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df3 = @pipe df2 |>\n",
" groupby(_, [:ost, :dst]) |>\n",
" combine(_, :occupied => mean∘skipmissing => :occupied, :Passengers => sum) |>\n",
" filter!(:occupied => isfinite, _) |>\n",
" sort!(_, :occupied, rev=true)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the above code note two things: we use `filter!` and `sort!` functions to process the data frame returned by `combine` in place (which reduces the number of allocations we make).\n",
"\n",
"Additionally note that when we aggregate `:occupied` column in `combine` using `mean∘skipmissing` then for some origin-destination state combinations we get zero observations, which produce `NaN`, so we filter them out using `isfinite` predicate."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Just to make sure what happens when we apply `mean∘skipmissing` to a vector containing only missing values consider the following simple example:"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>g</th><th>v_mean_skipmissing</th></tr><tr><th></th><th>Int64</th><th>Float64</th></tr></thead><tbody><p>2 rows × 2 columns</p><tr><th>1</th><td>1</td><td>1.5</td></tr><tr><th>2</th><td>2</td><td>NaN</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& g & v\\_mean\\_skipmissing\\\\\n",
"\t\\hline\n",
"\t& Int64 & Float64\\\\\n",
"\t\\hline\n",
"\t1 & 1 & 1.5 \\\\\n",
"\t2 & 2 & NaN \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m2×2 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m g \u001b[0m\u001b[1m v_mean_skipmissing \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m Int64 \u001b[0m\u001b[90m Float64 \u001b[0m\n",
"─────┼───────────────────────────\n",
" 1 │ 1 1.5\n",
" 2 │ 2 NaN"
]
},
"execution_count": 28,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@pipe DataFrame(g=[1,1,2,2], v=[1,2,missing, missing]) |>\n",
" groupby(_, :g) |>\n",
" combine(_, :v => mean∘skipmissing)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As a final example let us consider the following case. Assume that you want to query `df3` data frame by `:ost` and `:dst` columns very often.\n",
"\n",
"The simplest way to do it is to use `filter` as we have already discussed:"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>ost</th><th>dst</th><th>occupied</th><th>Passengers_sum</th></tr><tr><th></th><th>String</th><th>String</th><th>Float64</th><th>Int64</th></tr></thead><tbody><p>1 rows × 4 columns</p><tr><th>1</th><td>NE</td><td>AK</td><td>1.0</td><td>180</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cccc}\n",
"\t& ost & dst & occupied & Passengers\\_sum\\\\\n",
"\t\\hline\n",
"\t& String & String & Float64 & Int64\\\\\n",
"\t\\hline\n",
"\t1 & NE & AK & 1.0 & 180 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m1×4 DataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m ost \u001b[0m\u001b[1m dst \u001b[0m\u001b[1m occupied \u001b[0m\u001b[1m Passengers_sum \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Float64 \u001b[0m\u001b[90m Int64 \u001b[0m\n",
"─────┼──────────────────────────────────────────\n",
" 1 │ NE AK 1.0 180"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filter([:ost, :dst] => (ost, dst) -> ost == \"NE\" && dst == \"AK\", df3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"However this method is expensive. Consider e.g. the timing of this operation done for all combinations of `:ost` and `:dst`. We just want to calculate the total number of passengers in a fancy way:"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.306238 seconds (472.01 k allocations: 34.803 MiB)\n"
]
}
],
"source": [
"total1 = 0\n",
"@time for o in unique(df3.ost), d in unique(df3.dst)\n",
" res = filter([:ost, :dst] => (ost, dst) -> ost == o && dst == d, df3)\n",
" global total1 += sum(res.Passengers_sum)\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.361516 seconds (471.98 k allocations: 34.803 MiB)\n"
]
}
],
"source": [
"total1 = 0\n",
"@time for o in unique(df3.ost), d in unique(df3.dst)\n",
" res = filter([:ost, :dst] => (ost, dst) -> ost == o && dst == d, df3)\n",
" global total1 += sum(res.Passengers_sum)\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that we have run the operation twice to make sure we correctly handle compilation overhead."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now let us use a bit different technique. We `groupby` the `df3` data frame first:"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<p><b>GroupedDataFrame with 2369 groups based on keys: ost, dst</b></p><p><i>First Group (1 row): ost = \"NE\", dst = \"AK\"</i></p><table class=\"data-frame\"><thead><tr><th></th><th>ost</th><th>dst</th><th>occupied</th><th>Passengers_sum</th></tr><tr><th></th><th>String</th><th>String</th><th>Float64</th><th>Int64</th></tr></thead><tbody><tr><th>1</th><td>NE</td><td>AK</td><td>1.0</td><td>180</td></tr></tbody></table><p>&vellip;</p><p><i>Last Group (1 row): ost = \"AK\", dst = \"VA\"</i></p><table class=\"data-frame\"><thead><tr><th></th><th>ost</th><th>dst</th><th>occupied</th><th>Passengers_sum</th></tr><tr><th></th><th>String</th><th>String</th><th>Float64</th><th>Int64</th></tr></thead><tbody><tr><th>1</th><td>AK</td><td>VA</td><td>0.0</td><td>0</td></tr></tbody></table>"
],
"text/latex": [
"GroupedDataFrame with 2369 groups based on keys: ost, dst\n",
"\n",
"First Group (1 row): ost = \"NE\", dst = \"AK\"\n",
"\n",
"\\begin{tabular}{r|cccc}\n",
"\t& ost & dst & occupied & Passengers\\_sum\\\\\n",
"\t\\hline\n",
"\t& String & String & Float64 & Int64\\\\\n",
"\t\\hline\n",
"\t1 & NE & AK & 1.0 & 180 \\\\\n",
"\\end{tabular}\n",
"\n",
"$\\dots$\n",
"\n",
"Last Group (1 row): ost = \"AK\", dst = \"VA\"\n",
"\n",
"\\begin{tabular}{r|cccc}\n",
"\t& ost & dst & occupied & Passengers\\_sum\\\\\n",
"\t\\hline\n",
"\t& String & String & Float64 & Int64\\\\\n",
"\t\\hline\n",
"\t1 & AK & VA & 0.0 & 0 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"GroupedDataFrame with 2369 groups based on keys: ost, dst\n",
"First Group (1 row): ost = \"NE\", dst = \"AK\"\n",
"\u001b[1m Row \u001b[0m│\u001b[1m ost \u001b[0m\u001b[1m dst \u001b[0m\u001b[1m occupied \u001b[0m\u001b[1m Passengers_sum \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Float64 \u001b[0m\u001b[90m Int64 \u001b[0m\n",
"─────┼──────────────────────────────────────────\n",
" 1 │ NE AK 1.0 180\n",
"⋮\n",
"Last Group (1 row): ost = \"AK\", dst = \"VA\"\n",
"\u001b[1m Row \u001b[0m│\u001b[1m ost \u001b[0m\u001b[1m dst \u001b[0m\u001b[1m occupied \u001b[0m\u001b[1m Passengers_sum \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Float64 \u001b[0m\u001b[90m Int64 \u001b[0m\n",
"─────┼──────────────────────────────────────────\n",
" 1 │ AK VA 0.0 0"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gdf3 = groupby(df3, [:ost, :dst])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we can easiliy query it by group values (here we show such indexing by `Tuple` or `NamedTuple`):"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>ost</th><th>dst</th><th>occupied</th><th>Passengers_sum</th></tr><tr><th></th><th>String</th><th>String</th><th>Float64</th><th>Int64</th></tr></thead><tbody><p>1 rows × 4 columns</p><tr><th>1</th><td>NE</td><td>AK</td><td>1.0</td><td>180</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cccc}\n",
"\t& ost & dst & occupied & Passengers\\_sum\\\\\n",
"\t\\hline\n",
"\t& String & String & Float64 & Int64\\\\\n",
"\t\\hline\n",
"\t1 & NE & AK & 1.0 & 180 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m1×4 SubDataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m ost \u001b[0m\u001b[1m dst \u001b[0m\u001b[1m occupied \u001b[0m\u001b[1m Passengers_sum \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Float64 \u001b[0m\u001b[90m Int64 \u001b[0m\n",
"─────┼──────────────────────────────────────────\n",
" 1 │ NE AK 1.0 180"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gdf3[(\"NE\", \"AK\")]"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>ost</th><th>dst</th><th>occupied</th><th>Passengers_sum</th></tr><tr><th></th><th>String</th><th>String</th><th>Float64</th><th>Int64</th></tr></thead><tbody><p>1 rows × 4 columns</p><tr><th>1</th><td>NE</td><td>AK</td><td>1.0</td><td>180</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cccc}\n",
"\t& ost & dst & occupied & Passengers\\_sum\\\\\n",
"\t\\hline\n",
"\t& String & String & Float64 & Int64\\\\\n",
"\t\\hline\n",
"\t1 & NE & AK & 1.0 & 180 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"\u001b[1m1×4 SubDataFrame\u001b[0m\n",
"\u001b[1m Row \u001b[0m│\u001b[1m ost \u001b[0m\u001b[1m dst \u001b[0m\u001b[1m occupied \u001b[0m\u001b[1m Passengers_sum \u001b[0m\n",
"\u001b[1m \u001b[0m│\u001b[90m String \u001b[0m\u001b[90m String \u001b[0m\u001b[90m Float64 \u001b[0m\u001b[90m Int64 \u001b[0m\n",
"─────┼──────────────────────────────────────────\n",
" 1 │ NE AK 1.0 180"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gdf3[(ost=\"NE\", dst=\"AK\")]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the code below we will actually use a third way of querying the `GroupedDataFrame`:"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.117862 seconds (230.52 k allocations: 11.196 MiB)\n"
]
}
],
"source": [
"total2 = 0\n",
"@time for k in keys(gdf3)\n",
" res = gdf3[k]\n",
" global total2 += sum(res.Passengers_sum)\n",
"end"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.001509 seconds (20.89 k allocations: 844.609 KiB)\n"
]
}
],
"source": [
"total2 = 0\n",
"@time for k in keys(gdf3)\n",
" res = gdf3[k]\n",
" global total2 += sum(res.Passengers_sum)\n",
"end"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can see that the speed is of two orders of magnitude better now."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that what we addidionally did is we used `keys` on `GroupedDataFrame`:"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2369-element DataFrames.GroupKeys{GroupedDataFrame{DataFrame}}:\n",
" GroupKey: (ost = \"NE\", dst = \"AK\")\n",
" GroupKey: (ost = \"MD\", dst = \"ID\")\n",
" GroupKey: (ost = \"ID\", dst = \"AR\")\n",
" GroupKey: (ost = \"ID\", dst = \"MS\")\n",
" GroupKey: (ost = \"ND\", dst = \"RI\")\n",
" GroupKey: (ost = \"WY\", dst = \"NY\")\n",
" GroupKey: (ost = \"OR\", dst = \"RI\")\n",
" GroupKey: (ost = \"WV\", dst = \"NE\")\n",
" ⋮\n",
" GroupKey: (ost = \"RI\", dst = \"RI\")\n",
" GroupKey: (ost = \"MN\", dst = \"DE\")\n",
" GroupKey: (ost = \"AK\", dst = \"AR\")\n",
" GroupKey: (ost = \"DE\", dst = \"MN\")\n",
" GroupKey: (ost = \"AL\", dst = \"SD\")\n",
" GroupKey: (ost = \"SC\", dst = \"SD\")\n",
" GroupKey: (ost = \"AK\", dst = \"VA\")"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"keys(gdf3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this way we got only the origin-destination state combinations that are actually present in our `GroupedDataFrame`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The ability to query a `GroupedDataFrame` by grouping columns fast makes it a very useful way to add an index to a data frame."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Finally let us check that the results in both cases are correct."
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(9698370217, 9698370217, 9698370217)"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"total1, total2, sum(df3.Passengers_sum)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.5.3",
"language": "julia",
"name": "julia-1.5"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.5.3"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"id":"1", "3":8, "4":5, "2":2, "6":6, "8":11, "9":3, "5":21, "10":5, "7":7, "12":1, "17":3, "18":5, "13":2, "14":3, "21":4, "19":2, "15":1, "20":7, "breeding":4}
{"id":"3", "4":4, "6":4, "8":4, "9":8, "5":12, "10":12, "7":3, "12":2, "17":2, "18":7, "13":5, "14":1, "21":3, "19":4, "20":5, "16":1, "breeding":2}
{"id":"4", "1":1, "3":1, "2":3, "6":1, "8":4, "9":4, "5":8, "10":10, "7":1, "17":1, "18":4, "13":6, "21":2, "19":2, "15":3, "11":1, "20":4, "22":3, "breeding":3}
{"id":"26", "2":7, "25":1, "23":2, "10":3, "21":1, "19":1, "breeding":1}
{"id":"2", "1":1, "3":2, "4":3, "26":1, "6":1, "8":3, "5":3, "10":3, "7":2, "12":2, "17":1, "18":3, "13":2, "14":4, "21":1, "19":1, "15":1, "20":2, "breeding":1}
{"id":"25", "1":2, "24":8, "9":12, "23":1, "10":7, "14":8, "21":3, "19":3, "15":2, "breeding":3}
{"id":"6", "1":1, "8":5, "9":2, "5":6, "10":5, "7":1, "12":2, "17":1, "18":1, "13":3, "14":1, "19":1, "15":1, "20":4, "breeding":4}
{"id":"8", "1":2, "4":1, "2":1, "24":5, "9":11, "5":3, "23":6, "10":6, "17":4, "18":2, "13":2, "14":1, "19":6, "11":1, "20":7, "16":1, "22":1, "breeding":1}
{"id":"24", "4":1, "8":2, "9":2, "23":1, "10":2, "17":1, "13":1, "14":3, "21":3, "19":2, "15":2, "20":1, "breeding":4}
{"id":"9", "1":4, "4":1, "25":1, "6":2, "8":3, "24":1, "23":2, "10":9, "7":1, "17":4, "14":2, "21":4, "19":4, "15":3, "20":3, "16":2, "breeding":1}
{"id":"5", "1":1, "3":2, "2":1, "6":6, "8":4, "10":17, "7":3, "17":6, "18":5, "13":8, "21":2, "19":5, "15":2, "11":1, "20":4, "22":1, "breeding":3}
{"id":"23", "1":2, "2":1, "25":3, "8":1, "9":2, "10":1, "17":1, "13":5, "14":3, "21":3, "19":1, "20":1, "breeding":3}
{"id":"10", "1":1, "3":1, "6":1, "8":2, "24":1, "9":2, "5":1, "7":6, "17":3, "18":4, "13":4, "14":7, "21":6, "19":4, "15":5, "20":7, "16":2, "breeding":0}
{"id":"7", "1":3, "3":2, "8":1, "5":2, "12":3, "17":1, "18":2, "13":2, "14":3, "21":1, "19":1, "15":1, "20":4, "16":1, "22":1, "breeding":1}
{"id":"12", "4":1, "6":2, "10":3, "18":1, "13":2, "21":2, "20":4, "breeding":2}
{"id":"17", "1":1, "8":2, "9":2, "5":2, "10":1, "7":1, "18":8, "13":2, "14":2, "21":2, "19":3, "20":1, "breeding":0}
{"id":"18", "1":1, "4":1, "6":1, "8":5, "9":6, "5":3, "10":1, "7":1, "17":1, "13":1, "14":1, "21":1, "19":1, "15":1, "20":1, "breeding":0}
{"id":"13", "1":1, "6":2, "9":1, "5":2, "10":2, "7":1, "12":2, "17":1, "18":1, "14":3, "21":1, "19":3, "15":1, "11":1, "20":12, "16":1, "22":1, "breeding":1}
{"id":"14", "1":1, "4":1, "23":2, "10":1, "12":1, "17":4, "21":7, "19":3, "16":1, "breeding":0}
{"id":"21", "25":7, "24":1, "10":2, "7":1, "14":1, "19":5, "15":2, "11":1, "16":1, "breeding":1}
{"id":"19", "4":2, "9":2, "5":1, "10":1, "7":4, "17":1, "13":1, "14":1, "21":3, "15":5, "11":1, "20":3, "breeding":2}
{"id":"15", "10":1, "18":1, "13":1, "21":2, "20":9, "16":2, "breeding":1}
{"id":"11", "3":2, "2":1, "5":1, "13":4, "16":1, "22":9, "breeding":0}
{"id":"20", "6":1, "5":1, "7":2, "12":3, "17":3, "13":1, "14":2, "21":2, "19":1, "15":1, "breeding":1}
{"id":"16", "3":1, "6":2, "8":1, "5":1, "10":1, "18":1, "breeding":0}
{"id":"22", "10":1, "breeding":0}
# This file is machine-generated - editing it directly is not advised
[[Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "42c42f2221906892ceb765dbcb1a51deeffd86d7"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "2.3.0"
[[Artifacts]]
deps = ["Pkg"]
git-tree-sha1 = "c30985d8821e0cd73870b17b0ed0ce6dc44cb744"
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
version = "1.3.0"
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[BenchmarkTools]]
deps = ["JSON", "Logging", "Printf", "Statistics", "UUIDs"]
git-tree-sha1 = "9e62e66db34540a0c919d72172cc2f642ac71260"
uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
version = "0.5.0"
[[Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "c3598e525718abcc440f69cc6d5f60dda0a1b61e"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.6+5"
[[CSV]]
deps = ["Dates", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "Tables", "Unicode"]
git-tree-sha1 = "5f3ed063da881e9f309b0a8d543d8d1e4f5710fb"
uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
version = "0.8.0"
[[Cairo_jll]]
deps = ["Artifacts", "Bzip2_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "e2f47f6d8337369411569fd45ae5753ca10394c6"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.16.0+6"
[[CategoricalArrays]]
deps = ["DataAPI", "Future", "JSON", "Missings", "Printf", "Statistics", "StructTypes", "Unicode"]
git-tree-sha1 = "5861101791fa76fafe8dddefd70ffbfe4e33ecae"
uuid = "324d7699-5711-5eae-9e2f-1d82baa6b597"
version = "0.9.0"
[[ColorSchemes]]
deps = ["ColorTypes", "Colors", "FixedPointNumbers", "Random", "StaticArrays"]
git-tree-sha1 = "5d472aa8908568bc198564db06983913a6c2c8e7"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.10.1"
[[ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "4bffea7ed1a9f0f3d1a131bbcd4b925548d75288"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.10.9"
[[Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "InteractiveUtils", "Reexport"]
git-tree-sha1 = "008d6bc68dea6beb6303fdc37188cb557391ebf2"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.4"
[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "a706ff10f1cd8dab94f59fd09c0e657db8e77ff0"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.23.0"
[[Conda]]
deps = ["JSON", "VersionParsing"]
git-tree-sha1 = "c0647249d785f1d5139c0cc96db8f6b32f7ec416"
uuid = "8f4d0f93-b110-5947-807f-2305c1781a2d"
version = "1.5.0"
[[Contour]]
deps = ["StaticArrays"]
git-tree-sha1 = "0d128f9c2d9560349dc46f60c42036e244271d72"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.5.6"
[[Crayons]]
git-tree-sha1 = "3f71217b538d7aaee0b69ab47d9b7724ca8afa0d"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.0.4"
[[DataAPI]]
git-tree-sha1 = "ad84f52c0b8f05aa20839484dbaf01690b41ff84"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.4.0"
[[DataFrames]]
deps = ["CategoricalArrays", "Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "20159837c2e5e196793a313cd700b8199fd8f985"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "0.22.1"
[[DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "fb0aa371da91c1ff9dc7fbed6122d3e411420b9c"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.8"
[[DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"
[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[EarCut_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "92d8f9f208637e8d2d28c664051a00569c01493d"
uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
version = "2.1.5+1"
[[Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "1402e52fcda25064f51c77a9655ce8680b76acf0"
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
version = "2.2.7+6"
[[FFMPEG]]
deps = ["FFMPEG_jll", "x264_jll"]
git-tree-sha1 = "9a73ffdc375be61b0e4516d83d880b265366fe1f"
uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
version = "0.4.0"
[[FFMPEG_jll]]
deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "LibVPX_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "Pkg", "Zlib_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"]
git-tree-sha1 = "3cc57ad0a213808473eafef4845a74766242e05f"
uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5"
version = "4.3.1+4"
[[FileWatching]]
uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
[[FixedPointNumbers]]
deps = ["Statistics"]
git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc"
uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
version = "0.8.4"
[[Fontconfig_jll]]
deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "35895cf184ceaab11fd778b4590144034a167a2f"
uuid = "a3f928ae-7b40-5064-980b-68af3947d34b"
version = "2.13.1+14"
[[Formatting]]
deps = ["Printf"]
git-tree-sha1 = "a0c901c29c0e7c763342751c0a94211d56c0de5c"
uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
version = "0.4.1"
[[FreeType2_jll]]
deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "cbd58c9deb1d304f5a245a0b7eb841a2560cfec6"
uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7"
version = "2.10.1+5"
[[FriBidi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "0d20aed5b14dd4c9a2453c1b601d08e1149679cc"
uuid = "559328eb-81f9-559d-9380-de523a88c83c"
version = "1.0.5+6"
[[Future]]
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
[[GLFW_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"]
git-tree-sha1 = "a1bbf700b5388bffc3d882f4f4d625cf1c714fd7"
uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89"
version = "3.3.2+1"
[[GR]]
deps = ["Base64", "DelimitedFiles", "GR_jll", "HTTP", "JSON", "LinearAlgebra", "Pkg", "Printf", "Random", "Serialization", "Sockets", "Test", "UUIDs"]
git-tree-sha1 = "b90b826782cb3ac5b7a7f41b3fd0113180257ed4"
uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
version = "0.53.0"
[[GR_jll]]
deps = ["Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "GLFW_jll", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Pkg", "Qhull_jll", "Qt_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "daaccb414719ae63625b9b5e0eb4b1ec5b194590"
uuid = "d2c73de3-f751-5644-a686-071e5b155ba9"
version = "0.52.0+0"
[[GeometryBasics]]
deps = ["EarCut_jll", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"]
git-tree-sha1 = "876a906eab3be990fdcbfe1e43bb3a76f4776f72"
uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
version = "0.3.3"
[[Gettext_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"]
git-tree-sha1 = "8c14294a079216000a0bdca5ec5a447f073ddc9d"
uuid = "78b55507-aeef-58d4-861c-77aaff3498b1"
version = "0.20.1+7"
[[Glib_jll]]
deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "04690cc5008b38ecbdfede949220bc7d9ba26397"
uuid = "7746bdde-850d-59dc-9ae8-88ece973131d"
version = "2.59.0+4"
[[Grisu]]
git-tree-sha1 = "03d381f65183cb2d0af8b3425fde97263ce9a995"
uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe"
version = "1.0.0"
[[HTTP]]
deps = ["Base64", "Dates", "IniFile", "MbedTLS", "Sockets"]
git-tree-sha1 = "c7ec02c4c6a039a98a15f955462cd7aea5df4508"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "0.8.19"
[[IJulia]]
deps = ["Base64", "Conda", "Dates", "InteractiveUtils", "JSON", "Markdown", "MbedTLS", "Pkg", "Printf", "REPL", "Random", "SoftGlobalScope", "Test", "UUIDs", "ZMQ"]
git-tree-sha1 = "68e1792f3ca9a0df3b4e59d03a3aca828726917e"
uuid = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
version = "1.23.0"
[[IniFile]]
deps = ["Test"]
git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8"
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.0"
[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[[InvertedIndices]]
deps = ["Test"]
git-tree-sha1 = "15732c475062348b0165684ffe28e85ea8396afc"
uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
version = "1.0.0"
[[IterTools]]
git-tree-sha1 = "05110a2ab1fc5f932622ffea2a003221f4782c18"
uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
version = "1.3.0"
[[IteratorInterfaceExtensions]]
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"
[[JLLWrappers]]
git-tree-sha1 = "c70593677bbf2c3ccab4f7500d0f4dacfff7b75c"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.1.3"
[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.1"
[[JSON3]]
deps = ["Dates", "Mmap", "Parsers", "StructTypes", "UUIDs"]
git-tree-sha1 = "961ef1c3e5c8a595d5bec270a9007429ef12ed10"
uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
version = "1.5.1"
[[JpegTurbo_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "9aff0587d9603ea0de2c6f6300d9f9492bbefbd3"
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
version = "2.0.1+3"
[[LAME_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "df381151e871f41ee86cee4f5f6fd598b8a68826"
uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d"
version = "3.100.0+3"
[[LZO_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "f128cd6cd05ffd6d3df0523ed99b90ff6f9b349a"
uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac"
version = "2.10.0+3"
[[LaTeXStrings]]
git-tree-sha1 = "c7aebfecb1a60d59c0fe023a68ec947a208b1e6b"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
version = "1.2.0"
[[Latexify]]
deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"]
git-tree-sha1 = "8771ad2b1464aa6188899ca0c3e432341e35f96a"
uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
version = "0.14.5"
[[LibGit2]]
deps = ["Printf"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[LibVPX_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "85fcc80c3052be96619affa2fe2e6d2da3908e11"
uuid = "dd192d2f-8180-539f-9fb4-cc70b1dcf69a"
version = "1.9.0+1"
[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
[[Libffi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "a2cd088a88c0d37eef7d209fd3d8712febce0d90"
uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490"
version = "3.2.1+4"
[[Libgcrypt_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll", "Pkg"]
git-tree-sha1 = "b391a18ab1170a2e568f9fb8d83bc7c780cb9999"
uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4"
version = "1.8.5+4"
[[Libglvnd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"]
git-tree-sha1 = "7739f837d6447403596a75d19ed01fd08d6f56bf"
uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29"
version = "1.3.0+3"
[[Libgpg_error_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "ec7f2e8ad5c9fa99fc773376cdbc86d9a5a23cb7"
uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8"
version = "1.36.0+3"
[[Libiconv_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "8e924324b2e9275a51407a4e06deb3455b1e359f"
uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531"
version = "1.16.0+7"
[[Libmount_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "51ad0c01c94c1ce48d5cad629425035ad030bfd5"
uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9"
version = "2.34.0+3"
[[Libtiff_jll]]
deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Pkg", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "291dd857901f94d683973cdf679984cdf73b56d0"
uuid = "89763e89-9b03-5906-acba-b20f662cd828"
version = "4.1.0+2"
[[Libuuid_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "f879ae9edbaa2c74c922e8b85bb83cc84ea1450b"
uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700"
version = "2.34.0+7"
[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
[[MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "6a8a2a625ab0dea913aba95c11370589e0239ff0"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.6"
[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[MbedTLS]]
deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"]
git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "1.0.3"
[[MbedTLS_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "0eef589dd1c26a3ac9d753fe1a8bcad63f956fa6"
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
version = "2.16.8+1"
[[Measures]]
git-tree-sha1 = "e498ddeee6f9fdb4551ce855a46f54dbd900245f"
uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
version = "0.3.1"
[[Missings]]
deps = ["DataAPI"]
git-tree-sha1 = "ed61674a0864832495ffe0a7e889c0da76b0f4c8"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "0.4.4"
[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
[[NaNMath]]
git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb"
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
version = "0.3.5"
[[Ogg_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "a42c0f138b9ebe8b58eba2271c5053773bde52d0"
uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051"
version = "1.3.4+2"
[[OpenSSL_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "71bbbc616a1d710879f5a1021bcba65ffba6ce58"
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "1.1.1+6"
[[Opus_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "f9d57f4126c39565e05a2b0264df99f497fc6f37"
uuid = "91d4177d-7536-5919-b921-800302f37372"
version = "1.3.1+3"
[[OrderedCollections]]
git-tree-sha1 = "cf59cfed2e2c12e8a2ff0a4f1e9b2cd8650da6db"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.3.2"
[[PCRE_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "1b556ad51dceefdbf30e86ffa8f528b73c7df2bb"
uuid = "2f80f16e-611a-54ab-bc61-aa92de5b98fc"
version = "8.42.0+4"
[[Parsers]]
deps = ["Dates"]
git-tree-sha1 = "b417be52e8be24e916e34b3d70ec2da7bdf56a68"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "1.0.12"
[[Pipe]]
git-tree-sha1 = "6842804e7867b115ca9de748a0cf6b364523c16d"
uuid = "b98c9c47-44ae-5843-9183-064241ee97a0"
version = "1.3.0"
[[Pixman_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "392d85fe2fd2c613442f9694dd566c0d5641d58c"
uuid = "30392449-352a-5448-841d-b1acce4e97dc"
version = "0.38.4+5"
[[Pkg]]
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
[[PlotThemes]]
deps = ["PlotUtils", "Requires", "Statistics"]
git-tree-sha1 = "c6f5ea535551b3b16835134697f0c65d06c94b91"
uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a"
version = "2.0.0"
[[PlotUtils]]
deps = ["ColorSchemes", "Colors", "Dates", "Printf", "Random", "Reexport", "Statistics"]
git-tree-sha1 = "4e098f88dad9a2b518b83124a116be1c49e2b2bf"
uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043"
version = "1.0.7"
[[Plots]]
deps = ["Base64", "Contour", "Dates", "FFMPEG", "FixedPointNumbers", "GR", "GeometryBasics", "JSON", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "PlotThemes", "PlotUtils", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs"]
git-tree-sha1 = "173c7250ccd7c98615b04c669eb13fa7fab494b0"
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
version = "1.9.1"
[[PooledArrays]]
deps = ["DataAPI"]
git-tree-sha1 = "b1333d4eced1826e15adbdf01a4ecaccca9d353c"
uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
version = "0.5.3"
[[PrettyTables]]
deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"]
git-tree-sha1 = "237170206bf38a66fee4d845f4ae57f63788eeb0"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "0.10.1"
[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
[[Qhull_jll]]
deps = ["Libdl", "Pkg"]
git-tree-sha1 = "585989201bf8741e165ae52df54de79c5299daa7"
uuid = "784f63db-0788-585a-bace-daefebcd302b"
version = "2019.1.0+2"
[[Qt_jll]]
deps = ["Artifacts", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "xkbcommon_jll"]
git-tree-sha1 = "72244a8e084251aea25968c61bbf5c001aaa7d5a"
uuid = "ede63266-ebff-546c-83e0-1c6fb6d0efc8"
version = "5.15.1+0"
[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
[[RecipesBase]]
git-tree-sha1 = "b3fb709f3c97bfc6e948be68beeecb55a0b340ae"
uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
version = "1.1.1"
[[RecipesPipeline]]
deps = ["Dates", "NaNMath", "PlotUtils", "RecipesBase"]
git-tree-sha1 = "9ea2f5bf1b26918b16e9f885bb8e05206bfc2144"
uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c"
version = "0.2.1"
[[Reexport]]
deps = ["Pkg"]
git-tree-sha1 = "7b1d07f411bc8ddb7977ec7f377b97b158514fe0"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "0.2.0"
[[Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "e05c53ebc86933601d36212a93b39144a2733493"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.1.1"
[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[Scratch]]
deps = ["Dates"]
git-tree-sha1 = "ad4b278adb62d185bbcb6864dc24959ab0627bf6"
uuid = "6c6a2e73-6563-6170-7368-637461726353"
version = "1.0.3"
[[SentinelArrays]]
deps = ["Dates", "Random"]
git-tree-sha1 = "6ccde405cf0759eba835eb613130723cb8f10ff9"
uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c"
version = "1.2.16"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
[[Showoff]]
deps = ["Dates", "Grisu"]
git-tree-sha1 = "ee010d8f103468309b8afac4abb9be2e18ff1182"
uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f"
version = "0.3.2"
[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[SoftGlobalScope]]
deps = ["REPL"]
git-tree-sha1 = "986ec2b6162ccb95de5892ed17832f95badf770c"
uuid = "b85f4697-e234-5449-a836-ec8e2f98b302"
version = "1.1.0"
[[SortingAlgorithms]]
deps = ["DataStructures", "Random", "Test"]
git-tree-sha1 = "03f5898c9959f8115e30bc7226ada7d0df554ddd"
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
version = "0.3.1"
[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "da4cf579416c81994afd6322365d00916c79b8ae"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "0.12.5"
[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[[StatsBase]]
deps = ["DataAPI", "DataStructures", "LinearAlgebra", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics"]
git-tree-sha1 = "7bab7d4eb46b225b35179632852b595a3162cb61"
uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
version = "0.33.2"
[[StructArrays]]
deps = ["Adapt", "DataAPI", "Tables"]
git-tree-sha1 = "8099ed9fb90b6e754d6ba8c6ed8670f010eadca0"
uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
version = "0.4.4"
[[StructTypes]]
deps = ["Dates", "UUIDs"]
git-tree-sha1 = "1ed04f622a39d2e5a6747c3a70be040c00333933"
uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
version = "1.1.0"
[[TableTraits]]
deps = ["IteratorInterfaceExtensions"]
git-tree-sha1 = "b1ad568ba658d8cbb3b892ed5380a6f3e781a81e"
uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
version = "1.0.0"
[[Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"]
git-tree-sha1 = "5131a624173d532299d1c7eb05341c18112b21b8"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.2.1"
[[Test]]
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
[[VersionParsing]]
git-tree-sha1 = "80229be1f670524750d905f8fc8148e5a8c4537f"
uuid = "81def892-9a0e-5fdd-b105-ffc91e053289"
version = "1.2.0"
[[Wayland_jll]]
deps = ["Artifacts", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"]
git-tree-sha1 = "dc643a9b774da1c2781413fd7b6dcd2c56bb8056"
uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89"
version = "1.17.0+4"
[[Wayland_protocols_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll"]
git-tree-sha1 = "2839f1c1296940218e35df0bbb220f2a79686670"
uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91"
version = "1.18.0+4"
[[XML2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"]
git-tree-sha1 = "be0db24f70aae7e2b89f2f3092e93b8606d659a6"
uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
version = "2.9.10+3"
[[XSLT_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Pkg", "XML2_jll"]
git-tree-sha1 = "2b3eac39df218762d2d005702d601cd44c997497"
uuid = "aed1982a-8fda-507f-9586-7b0439959a61"
version = "1.1.33+4"
[[Xorg_libX11_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll", "Xorg_xtrans_jll"]
git-tree-sha1 = "5be649d550f3f4b95308bf0183b82e2582876527"
uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc"
version = "1.6.9+4"
[[Xorg_libXau_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "4e490d5c960c314f33885790ed410ff3a94ce67e"
uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec"
version = "1.0.9+4"
[[Xorg_libXcursor_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"]
git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd"
uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724"
version = "1.2.0+4"
[[Xorg_libXdmcp_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "4fe47bd2247248125c428978740e18a681372dd4"
uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05"
version = "1.1.3+4"
[[Xorg_libXext_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3"
uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3"
version = "1.3.4+4"
[[Xorg_libXfixes_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4"
uuid = "d091e8ba-531a-589c-9de9-94069b037ed8"
version = "5.0.3+4"
[[Xorg_libXi_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"]
git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246"
uuid = "a51aa0fd-4e3c-5386-b890-e753decda492"
version = "1.7.10+4"
[[Xorg_libXinerama_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"]
git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123"
uuid = "d1454406-59df-5ea1-beac-c340f2130bc3"
version = "1.1.4+4"
[[Xorg_libXrandr_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"]
git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631"
uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484"
version = "1.5.2+4"
[[Xorg_libXrender_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96"
uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa"
version = "0.9.10+4"
[[Xorg_libpthread_stubs_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "6783737e45d3c59a4a4c4091f5f88cdcf0908cbb"
uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74"
version = "0.1.0+3"
[[Xorg_libxcb_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"]
git-tree-sha1 = "daf17f441228e7a3833846cd048892861cff16d6"
uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b"
version = "1.13.0+3"
[[Xorg_libxkbfile_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"]
git-tree-sha1 = "926af861744212db0eb001d9e40b5d16292080b2"
uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a"
version = "1.1.0+4"
[[Xorg_xcb_util_image_jll]]
deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"]
git-tree-sha1 = "16eb9a5aa027fb877207bf9915686366c2d5c064"
uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b"
version = "0.4.0+0"
[[Xorg_xcb_util_jll]]
deps = ["Libdl", "Pkg", "Xorg_libxcb_jll"]
git-tree-sha1 = "6b47a94261a67078fe3d3922363bd9fd83b6eb1d"
uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5"
version = "0.4.0+0"
[[Xorg_xcb_util_keysyms_jll]]
deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"]
git-tree-sha1 = "40771f688e17baa121136b649e631e1868a6678e"
uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7"
version = "0.4.0+0"
[[Xorg_xcb_util_renderutil_jll]]
deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"]
git-tree-sha1 = "72c9b59211a97f763a9ca82351d37ebc04a6858a"
uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e"
version = "0.3.9+0"
[[Xorg_xcb_util_wm_jll]]
deps = ["Libdl", "Pkg", "Xorg_xcb_util_jll"]
git-tree-sha1 = "6ed52e9bfb2421f01ee62e1a5a30eba5f3f29c74"
uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361"
version = "0.4.1+0"
[[Xorg_xkbcomp_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxkbfile_jll"]
git-tree-sha1 = "4bcbf660f6c2e714f87e960a171b119d06ee163b"
uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4"
version = "1.4.2+4"
[[Xorg_xkeyboard_config_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xkbcomp_jll"]
git-tree-sha1 = "5c8424f8a67c3f2209646d4425f3d415fee5931d"
uuid = "33bec58e-1273-512f-9401-5d533626f822"
version = "2.27.0+4"
[[Xorg_xtrans_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "79c31e7844f6ecf779705fbc12146eb190b7d845"
uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10"
version = "1.4.0+3"
[[ZMQ]]
deps = ["FileWatching", "Sockets", "ZeroMQ_jll"]
git-tree-sha1 = "fc68e8a3719166950a0f3e390a14c7302c48f8de"
uuid = "c2297ded-f4af-51ae-bb23-16f91089e4e1"
version = "1.2.1"
[[ZeroMQ_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "bba617292e040408cb72baa03c20f43583bf239f"
uuid = "8f1865be-045e-5c20-9c9f-bfbfb0764568"
version = "4.3.2+5"
[[Zlib_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "320228915c8debb12cb434c59057290f0834dbf6"
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
version = "1.2.11+18"
[[Zstd_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "6f1abcb0c44f184690912aa4b0ba861dd64f11b9"
uuid = "3161d3a3-bdf6-5164-811a-617609db77b4"
version = "1.4.5+2"
[[libass_jll]]
deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "acc685bcf777b2202a904cdcb49ad34c2fa1880c"
uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0"
version = "0.14.0+4"
[[libfdk_aac_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "7a5780a0d9c6864184b3a2eeeb833a0c871f00ab"
uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280"
version = "0.1.6+4"
[[libpng_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"]
git-tree-sha1 = "6abbc424248097d69c0c87ba50fcb0753f93e0ee"
uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f"
version = "1.6.37+6"
[[libvorbis_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"]
git-tree-sha1 = "fa14ac25af7a4b8a7f61b287a124df7aab601bcd"
uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a"
version = "1.3.6+6"
[[x264_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "d713c1ce4deac133e3334ee12f4adff07f81778f"
uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a"
version = "2020.7.14+2"
[[x265_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "487da2f8f2f0c8ee0e83f39d13037d6bbf0a45ab"
uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76"
version = "3.0.0+3"
[[xkbcommon_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"]
git-tree-sha1 = "ece2350174195bb31de1a63bea3a41ae1aa593b6"
uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd"
version = "0.9.1+5"
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Pipe = "b98c9c47-44ae-5843-9183-064241ee97a0"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment