daily pastebin goal
76%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.  "cells": [
  3.   {
  4.    "cell_type": "code",
  5.    "execution_count": 586,
  6.    "metadata": {},
  7.    "outputs": [],
  8.    "source": [
  9.     "import pandas\n",
  10.     "import pandas as pd  # an alias for pandas\n",
  11.     "import numpy as np\n",
  12.     "import matplotlib.pyplot as plt\n",
  13.     "import csv\n",
  14.     "import reverse_geocoder as rg\n",
  15.     "import matplotlib"
  16.    ]
  17.   },
  18.   {
  19.    "cell_type": "code",
  20.    "execution_count": 587,
  21.    "metadata": {},
  22.    "outputs": [],
  23.    "source": [
  24.     "a = \"taxi-trips.csv\"\n",
  25.     "file = open(a, newline= '')\n",
  26.     "reader= csv.reader(file)"
  27.    ]
  28.   },
  29.   {
  30.    "cell_type": "code",
  31.    "execution_count": 588,
  32.    "metadata": {},
  33.    "outputs": [],
  34.    "source": [
  35.     "C = pd.read_csv('taxi-trips.csv', delimiter = ',')"
  36.    ]
  37.   },
  38.   {
  39.    "cell_type": "code",
  40.    "execution_count": 589,
  41.    "metadata": {},
  42.    "outputs": [
  43.     {
  44.      "data": {
  45.       "text/html": [
  46.        "<div>\n",
  47.        "<style scoped>\n",
  48.        "    .dataframe tbody tr th:only-of-type {\n",
  49.        "        vertical-align: middle;\n",
  50.        "    }\n",
  51.        "\n",
  52.        "    .dataframe tbody tr th {\n",
  53.        "        vertical-align: top;\n",
  54.        "    }\n",
  55.        "\n",
  56.        "    .dataframe thead th {\n",
  57.        "        text-align: right;\n",
  58.        "    }\n",
  59.        "</style>\n",
  60.        "<table border=\"1\" class=\"dataframe\">\n",
  61.        "  <thead>\n",
  62.        "    <tr style=\"text-align: right;\">\n",
  63.        "      <th></th>\n",
  64.        "      <th>id</th>\n",
  65.        "      <th>vendor_id</th>\n",
  66.        "      <th>pickup_datetime</th>\n",
  67.        "      <th>dropoff_datetime</th>\n",
  68.        "      <th>passenger_count</th>\n",
  69.        "      <th>pickup_longitude</th>\n",
  70.        "      <th>pickup_latitude</th>\n",
  71.        "      <th>dropoff_longitude</th>\n",
  72.        "      <th>dropoff_latitude</th>\n",
  73.        "      <th>store_and_fwd_flag</th>\n",
  74.        "      <th>trip_duration</th>\n",
  75.        "    </tr>\n",
  76.        "  </thead>\n",
  77.        "  <tbody>\n",
  78.        "    <tr>\n",
  79.        "      <th>0</th>\n",
  80.        "      <td>id2875421</td>\n",
  81.        "      <td>2</td>\n",
  82.        "      <td>2016-03-14 17:24:55</td>\n",
  83.        "      <td>2016-03-14 17:32:30</td>\n",
  84.        "      <td>1</td>\n",
  85.        "      <td>-73.982155</td>\n",
  86.        "      <td>40.767937</td>\n",
  87.        "      <td>-73.964630</td>\n",
  88.        "      <td>40.765602</td>\n",
  89.        "      <td>N</td>\n",
  90.        "      <td>455</td>\n",
  91.        "    </tr>\n",
  92.        "    <tr>\n",
  93.        "      <th>1</th>\n",
  94.        "      <td>id0012891</td>\n",
  95.        "      <td>2</td>\n",
  96.        "      <td>2016-03-10 21:45:01</td>\n",
  97.        "      <td>2016-03-10 22:05:26</td>\n",
  98.        "      <td>1</td>\n",
  99.        "      <td>-73.981049</td>\n",
  100.        "      <td>40.744339</td>\n",
  101.        "      <td>-73.973000</td>\n",
  102.        "      <td>40.789989</td>\n",
  103.        "      <td>N</td>\n",
  104.        "      <td>1225</td>\n",
  105.        "    </tr>\n",
  106.        "    <tr>\n",
  107.        "      <th>2</th>\n",
  108.        "      <td>id3361153</td>\n",
  109.        "      <td>1</td>\n",
  110.        "      <td>2016-03-11 07:11:23</td>\n",
  111.        "      <td>2016-03-11 07:20:09</td>\n",
  112.        "      <td>1</td>\n",
  113.        "      <td>-73.994560</td>\n",
  114.        "      <td>40.750526</td>\n",
  115.        "      <td>-73.978500</td>\n",
  116.        "      <td>40.756191</td>\n",
  117.        "      <td>N</td>\n",
  118.        "      <td>526</td>\n",
  119.        "    </tr>\n",
  120.        "    <tr>\n",
  121.        "      <th>3</th>\n",
  122.        "      <td>id2129090</td>\n",
  123.        "      <td>1</td>\n",
  124.        "      <td>2016-03-14 14:05:39</td>\n",
  125.        "      <td>2016-03-14 14:28:05</td>\n",
  126.        "      <td>1</td>\n",
  127.        "      <td>-73.975090</td>\n",
  128.        "      <td>40.758766</td>\n",
  129.        "      <td>-73.953201</td>\n",
  130.        "      <td>40.765068</td>\n",
  131.        "      <td>N</td>\n",
  132.        "      <td>1346</td>\n",
  133.        "    </tr>\n",
  134.        "    <tr>\n",
  135.        "      <th>4</th>\n",
  136.        "      <td>id0256505</td>\n",
  137.        "      <td>1</td>\n",
  138.        "      <td>2016-03-14 15:04:38</td>\n",
  139.        "      <td>2016-03-14 15:16:13</td>\n",
  140.        "      <td>1</td>\n",
  141.        "      <td>-73.994484</td>\n",
  142.        "      <td>40.745087</td>\n",
  143.        "      <td>-73.998993</td>\n",
  144.        "      <td>40.722710</td>\n",
  145.        "      <td>N</td>\n",
  146.        "      <td>695</td>\n",
  147.        "    </tr>\n",
  148.        "    <tr>\n",
  149.        "      <th>5</th>\n",
  150.        "      <td>id0970832</td>\n",
  151.        "      <td>1</td>\n",
  152.        "      <td>2016-03-12 20:39:39</td>\n",
  153.        "      <td>2016-03-12 21:05:40</td>\n",
  154.        "      <td>1</td>\n",
  155.        "      <td>-74.008247</td>\n",
  156.        "      <td>40.747353</td>\n",
  157.        "      <td>-73.979446</td>\n",
  158.        "      <td>40.718750</td>\n",
  159.        "      <td>N</td>\n",
  160.        "      <td>1561</td>\n",
  161.        "    </tr>\n",
  162.        "    <tr>\n",
  163.        "      <th>6</th>\n",
  164.        "      <td>id2049424</td>\n",
  165.        "      <td>2</td>\n",
  166.        "      <td>2016-03-02 20:15:07</td>\n",
  167.        "      <td>2016-03-02 20:37:43</td>\n",
  168.        "      <td>1</td>\n",
  169.        "      <td>-73.963890</td>\n",
  170.        "      <td>40.773651</td>\n",
  171.        "      <td>-74.005112</td>\n",
  172.        "      <td>40.751492</td>\n",
  173.        "      <td>N</td>\n",
  174.        "      <td>1356</td>\n",
  175.        "    </tr>\n",
  176.        "    <tr>\n",
  177.        "      <th>7</th>\n",
  178.        "      <td>id0038484</td>\n",
  179.        "      <td>2</td>\n",
  180.        "      <td>2016-03-09 13:41:11</td>\n",
  181.        "      <td>2016-03-09 13:53:27</td>\n",
  182.        "      <td>2</td>\n",
  183.        "      <td>-73.972855</td>\n",
  184.        "      <td>40.764400</td>\n",
  185.        "      <td>-73.971809</td>\n",
  186.        "      <td>40.757889</td>\n",
  187.        "      <td>N</td>\n",
  188.        "      <td>736</td>\n",
  189.        "    </tr>\n",
  190.        "    <tr>\n",
  191.        "      <th>8</th>\n",
  192.        "      <td>id3092788</td>\n",
  193.        "      <td>2</td>\n",
  194.        "      <td>2016-03-03 22:01:32</td>\n",
  195.        "      <td>2016-03-03 22:17:44</td>\n",
  196.        "      <td>2</td>\n",
  197.        "      <td>-73.984772</td>\n",
  198.        "      <td>40.710571</td>\n",
  199.        "      <td>-73.989410</td>\n",
  200.        "      <td>40.730148</td>\n",
  201.        "      <td>N</td>\n",
  202.        "      <td>972</td>\n",
  203.        "    </tr>\n",
  204.        "    <tr>\n",
  205.        "      <th>9</th>\n",
  206.        "      <td>id3863815</td>\n",
  207.        "      <td>2</td>\n",
  208.        "      <td>2016-03-14 04:24:36</td>\n",
  209.        "      <td>2016-03-14 04:37:11</td>\n",
  210.        "      <td>3</td>\n",
  211.        "      <td>-73.944359</td>\n",
  212.        "      <td>40.714489</td>\n",
  213.        "      <td>-73.910530</td>\n",
  214.        "      <td>40.709492</td>\n",
  215.        "      <td>N</td>\n",
  216.        "      <td>755</td>\n",
  217.        "    </tr>\n",
  218.        "    <tr>\n",
  219.        "      <th>10</th>\n",
  220.        "      <td>id1832737</td>\n",
  221.        "      <td>2</td>\n",
  222.        "      <td>2016-03-06 10:53:26</td>\n",
  223.        "      <td>2016-03-06 10:59:30</td>\n",
  224.        "      <td>1</td>\n",
  225.        "      <td>-73.984711</td>\n",
  226.        "      <td>40.760181</td>\n",
  227.        "      <td>-73.979561</td>\n",
  228.        "      <td>40.752705</td>\n",
  229.        "      <td>N</td>\n",
  230.        "      <td>364</td>\n",
  231.        "    </tr>\n",
  232.        "    <tr>\n",
  233.        "      <th>11</th>\n",
  234.        "      <td>id2718231</td>\n",
  235.        "      <td>1</td>\n",
  236.        "      <td>2016-03-08 02:44:19</td>\n",
  237.        "      <td>2016-03-08 03:04:35</td>\n",
  238.        "      <td>1</td>\n",
  239.        "      <td>-73.992500</td>\n",
  240.        "      <td>40.740444</td>\n",
  241.        "      <td>-73.840111</td>\n",
  242.        "      <td>40.719517</td>\n",
  243.        "      <td>N</td>\n",
  244.        "      <td>1216</td>\n",
  245.        "    </tr>\n",
  246.        "    <tr>\n",
  247.        "      <th>12</th>\n",
  248.        "      <td>id3956459</td>\n",
  249.        "      <td>2</td>\n",
  250.        "      <td>2016-03-05 10:23:45</td>\n",
  251.        "      <td>2016-03-05 10:45:52</td>\n",
  252.        "      <td>1</td>\n",
  253.        "      <td>-73.986908</td>\n",
  254.        "      <td>40.761608</td>\n",
  255.        "      <td>-74.008408</td>\n",
  256.        "      <td>40.711620</td>\n",
  257.        "      <td>N</td>\n",
  258.        "      <td>1327</td>\n",
  259.        "    </tr>\n",
  260.        "    <tr>\n",
  261.        "      <th>13</th>\n",
  262.        "      <td>id2393811</td>\n",
  263.        "      <td>1</td>\n",
  264.        "      <td>2016-03-10 18:52:40</td>\n",
  265.        "      <td>2016-03-10 19:08:43</td>\n",
  266.        "      <td>1</td>\n",
  267.        "      <td>-73.970581</td>\n",
  268.        "      <td>40.799046</td>\n",
  269.        "      <td>-73.989815</td>\n",
  270.        "      <td>40.767246</td>\n",
  271.        "      <td>N</td>\n",
  272.        "      <td>963</td>\n",
  273.        "    </tr>\n",
  274.        "    <tr>\n",
  275.        "      <th>14</th>\n",
  276.        "      <td>id2808378</td>\n",
  277.        "      <td>1</td>\n",
  278.        "      <td>2016-03-09 17:11:16</td>\n",
  279.        "      <td>2016-03-09 17:28:43</td>\n",
  280.        "      <td>1</td>\n",
  281.        "      <td>-73.978645</td>\n",
  282.        "      <td>40.740932</td>\n",
  283.        "      <td>-74.012695</td>\n",
  284.        "      <td>40.701588</td>\n",
  285.        "      <td>N</td>\n",
  286.        "      <td>1047</td>\n",
  287.        "    </tr>\n",
  288.        "    <tr>\n",
  289.        "      <th>15</th>\n",
  290.        "      <td>id1295254</td>\n",
  291.        "      <td>1</td>\n",
  292.        "      <td>2016-03-06 11:01:27</td>\n",
  293.        "      <td>2016-03-06 11:08:29</td>\n",
  294.        "      <td>1</td>\n",
  295.        "      <td>-73.975983</td>\n",
  296.        "      <td>40.757748</td>\n",
  297.        "      <td>-73.982162</td>\n",
  298.        "      <td>40.740749</td>\n",
  299.        "      <td>N</td>\n",
  300.        "      <td>422</td>\n",
  301.        "    </tr>\n",
  302.        "    <tr>\n",
  303.        "      <th>16</th>\n",
  304.        "      <td>id1660823</td>\n",
  305.        "      <td>2</td>\n",
  306.        "      <td>2016-03-01 06:40:18</td>\n",
  307.        "      <td>2016-03-01 07:01:37</td>\n",
  308.        "      <td>5</td>\n",
  309.        "      <td>-73.982140</td>\n",
  310.        "      <td>40.775326</td>\n",
  311.        "      <td>-74.009850</td>\n",
  312.        "      <td>40.721699</td>\n",
  313.        "      <td>N</td>\n",
  314.        "      <td>1279</td>\n",
  315.        "    </tr>\n",
  316.        "    <tr>\n",
  317.        "      <th>17</th>\n",
  318.        "      <td>id0802391</td>\n",
  319.        "      <td>1</td>\n",
  320.        "      <td>2016-03-06 17:44:45</td>\n",
  321.        "      <td>2016-03-06 17:52:14</td>\n",
  322.        "      <td>1</td>\n",
  323.        "      <td>-73.997208</td>\n",
  324.        "      <td>40.724072</td>\n",
  325.        "      <td>-74.000618</td>\n",
  326.        "      <td>40.732155</td>\n",
  327.        "      <td>N</td>\n",
  328.        "      <td>449</td>\n",
  329.        "    </tr>\n",
  330.        "    <tr>\n",
  331.        "      <th>18</th>\n",
  332.        "      <td>id2268459</td>\n",
  333.        "      <td>1</td>\n",
  334.        "      <td>2016-03-02 07:02:21</td>\n",
  335.        "      <td>2016-03-02 07:24:57</td>\n",
  336.        "      <td>1</td>\n",
  337.        "      <td>-73.985359</td>\n",
  338.        "      <td>40.738411</td>\n",
  339.        "      <td>-73.870422</td>\n",
  340.        "      <td>40.773682</td>\n",
  341.        "      <td>N</td>\n",
  342.        "      <td>1356</td>\n",
  343.        "    </tr>\n",
  344.        "    <tr>\n",
  345.        "      <th>19</th>\n",
  346.        "      <td>id2797773</td>\n",
  347.        "      <td>1</td>\n",
  348.        "      <td>2016-03-08 08:33:35</td>\n",
  349.        "      <td>2016-03-08 08:36:35</td>\n",
  350.        "      <td>1</td>\n",
  351.        "      <td>-73.967133</td>\n",
  352.        "      <td>40.793465</td>\n",
  353.        "      <td>-73.970390</td>\n",
  354.        "      <td>40.795750</td>\n",
  355.        "      <td>N</td>\n",
  356.        "      <td>180</td>\n",
  357.        "    </tr>\n",
  358.        "    <tr>\n",
  359.        "      <th>20</th>\n",
  360.        "      <td>id3817493</td>\n",
  361.        "      <td>2</td>\n",
  362.        "      <td>2016-03-14 14:57:56</td>\n",
  363.        "      <td>2016-03-14 15:15:26</td>\n",
  364.        "      <td>1</td>\n",
  365.        "      <td>-73.952881</td>\n",
  366.        "      <td>40.766468</td>\n",
  367.        "      <td>-73.978630</td>\n",
  368.        "      <td>40.761921</td>\n",
  369.        "      <td>N</td>\n",
  370.        "      <td>1050</td>\n",
  371.        "    </tr>\n",
  372.        "    <tr>\n",
  373.        "      <th>21</th>\n",
  374.        "      <td>id1971518</td>\n",
  375.        "      <td>1</td>\n",
  376.        "      <td>2016-03-12 13:04:28</td>\n",
  377.        "      <td>2016-03-12 13:14:33</td>\n",
  378.        "      <td>1</td>\n",
  379.        "      <td>-73.988976</td>\n",
  380.        "      <td>40.759205</td>\n",
  381.        "      <td>-73.973991</td>\n",
  382.        "      <td>40.760590</td>\n",
  383.        "      <td>N</td>\n",
  384.        "      <td>605</td>\n",
  385.        "    </tr>\n",
  386.        "    <tr>\n",
  387.        "      <th>22</th>\n",
  388.        "      <td>id3911487</td>\n",
  389.        "      <td>1</td>\n",
  390.        "      <td>2016-03-03 17:56:45</td>\n",
  391.        "      <td>2016-03-03 18:05:28</td>\n",
  392.        "      <td>1</td>\n",
  393.        "      <td>-73.962112</td>\n",
  394.        "      <td>40.776100</td>\n",
  395.        "      <td>-73.968521</td>\n",
  396.        "      <td>40.764408</td>\n",
  397.        "      <td>N</td>\n",
  398.        "      <td>523</td>\n",
  399.        "    </tr>\n",
  400.        "    <tr>\n",
  401.        "      <th>23</th>\n",
  402.        "      <td>id3276198</td>\n",
  403.        "      <td>2</td>\n",
  404.        "      <td>2016-03-14 20:31:12</td>\n",
  405.        "      <td>2016-03-14 20:36:18</td>\n",
  406.        "      <td>1</td>\n",
  407.        "      <td>-73.981911</td>\n",
  408.        "      <td>40.766880</td>\n",
  409.        "      <td>-73.982597</td>\n",
  410.        "      <td>40.777180</td>\n",
  411.        "      <td>N</td>\n",
  412.        "      <td>306</td>\n",
  413.        "    </tr>\n",
  414.        "    <tr>\n",
  415.        "      <th>24</th>\n",
  416.        "      <td>id1527676</td>\n",
  417.        "      <td>1</td>\n",
  418.        "      <td>2016-03-07 19:38:25</td>\n",
  419.        "      <td>2016-03-07 19:54:35</td>\n",
  420.        "      <td>2</td>\n",
  421.        "      <td>-73.986130</td>\n",
  422.        "      <td>40.759720</td>\n",
  423.        "      <td>-74.001488</td>\n",
  424.        "      <td>40.736065</td>\n",
  425.        "      <td>N</td>\n",
  426.        "      <td>970</td>\n",
  427.        "    </tr>\n",
  428.        "    <tr>\n",
  429.        "      <th>25</th>\n",
  430.        "      <td>id1146853</td>\n",
  431.        "      <td>2</td>\n",
  432.        "      <td>2016-03-05 02:59:30</td>\n",
  433.        "      <td>2016-03-05 03:20:50</td>\n",
  434.        "      <td>4</td>\n",
  435.        "      <td>-74.005394</td>\n",
  436.        "      <td>40.740810</td>\n",
  437.        "      <td>-73.950630</td>\n",
  438.        "      <td>40.821037</td>\n",
  439.        "      <td>N</td>\n",
  440.        "      <td>1280</td>\n",
  441.        "    </tr>\n",
  442.        "    <tr>\n",
  443.        "      <th>26</th>\n",
  444.        "      <td>id3714906</td>\n",
  445.        "      <td>1</td>\n",
  446.        "      <td>2016-03-01 08:33:57</td>\n",
  447.        "      <td>2016-03-01 08:40:44</td>\n",
  448.        "      <td>1</td>\n",
  449.        "      <td>-73.989494</td>\n",
  450.        "      <td>40.753677</td>\n",
  451.        "      <td>-73.988335</td>\n",
  452.        "      <td>40.745949</td>\n",
  453.        "      <td>N</td>\n",
  454.        "      <td>407</td>\n",
  455.        "    </tr>\n",
  456.        "    <tr>\n",
  457.        "      <th>27</th>\n",
  458.        "      <td>id1937745</td>\n",
  459.        "      <td>2</td>\n",
  460.        "      <td>2016-03-07 18:51:46</td>\n",
  461.        "      <td>2016-03-07 18:58:30</td>\n",
  462.        "      <td>2</td>\n",
  463.        "      <td>-73.990974</td>\n",
  464.        "      <td>40.760632</td>\n",
  465.        "      <td>-73.994720</td>\n",
  466.        "      <td>40.750450</td>\n",
  467.        "      <td>N</td>\n",
  468.        "      <td>404</td>\n",
  469.        "    </tr>\n",
  470.        "    <tr>\n",
  471.        "      <th>28</th>\n",
  472.        "      <td>id2672200</td>\n",
  473.        "      <td>1</td>\n",
  474.        "      <td>2016-03-08 10:59:46</td>\n",
  475.        "      <td>2016-03-08 11:21:50</td>\n",
  476.        "      <td>1</td>\n",
  477.        "      <td>-73.964325</td>\n",
  478.        "      <td>40.773594</td>\n",
  479.        "      <td>-73.989769</td>\n",
  480.        "      <td>40.738483</td>\n",
  481.        "      <td>N</td>\n",
  482.        "      <td>1324</td>\n",
  483.        "    </tr>\n",
  484.        "    <tr>\n",
  485.        "      <th>29</th>\n",
  486.        "      <td>id3200728</td>\n",
  487.        "      <td>2</td>\n",
  488.        "      <td>2016-03-03 10:14:57</td>\n",
  489.        "      <td>2016-03-03 10:32:51</td>\n",
  490.        "      <td>1</td>\n",
  491.        "      <td>-73.995880</td>\n",
  492.        "      <td>40.759190</td>\n",
  493.        "      <td>-73.979874</td>\n",
  494.        "      <td>40.752781</td>\n",
  495.        "      <td>N</td>\n",
  496.        "      <td>1074</td>\n",
  497.        "    </tr>\n",
  498.        "    <tr>\n",
  499.        "      <th>...</th>\n",
  500.        "      <td>...</td>\n",
  501.        "      <td>...</td>\n",
  502.        "      <td>...</td>\n",
  503.        "      <td>...</td>\n",
  504.        "      <td>...</td>\n",
  505.        "      <td>...</td>\n",
  506.        "      <td>...</td>\n",
  507.        "      <td>...</td>\n",
  508.        "      <td>...</td>\n",
  509.        "      <td>...</td>\n",
  510.        "      <td>...</td>\n",
  511.        "    </tr>\n",
  512.        "    <tr>\n",
  513.        "      <th>118155</th>\n",
  514.        "      <td>id2073065</td>\n",
  515.        "      <td>2</td>\n",
  516.        "      <td>2016-03-10 21:43:30</td>\n",
  517.        "      <td>2016-03-10 21:50:55</td>\n",
  518.        "      <td>1</td>\n",
  519.        "      <td>-73.989738</td>\n",
  520.        "      <td>40.756599</td>\n",
  521.        "      <td>-74.005318</td>\n",
  522.        "      <td>40.740231</td>\n",
  523.        "      <td>N</td>\n",
  524.        "      <td>445</td>\n",
  525.        "    </tr>\n",
  526.        "    <tr>\n",
  527.        "      <th>118156</th>\n",
  528.        "      <td>id1042737</td>\n",
  529.        "      <td>2</td>\n",
  530.        "      <td>2016-03-10 06:10:29</td>\n",
  531.        "      <td>2016-03-10 06:13:15</td>\n",
  532.        "      <td>1</td>\n",
  533.        "      <td>-73.985954</td>\n",
  534.        "      <td>40.752129</td>\n",
  535.        "      <td>-73.978592</td>\n",
  536.        "      <td>40.752602</td>\n",
  537.        "      <td>N</td>\n",
  538.        "      <td>166</td>\n",
  539.        "    </tr>\n",
  540.        "    <tr>\n",
  541.        "      <th>118157</th>\n",
  542.        "      <td>id0538386</td>\n",
  543.        "      <td>1</td>\n",
  544.        "      <td>2016-03-07 18:29:35</td>\n",
  545.        "      <td>2016-03-07 18:36:43</td>\n",
  546.        "      <td>1</td>\n",
  547.        "      <td>-73.976997</td>\n",
  548.        "      <td>40.755756</td>\n",
  549.        "      <td>-73.990540</td>\n",
  550.        "      <td>40.751163</td>\n",
  551.        "      <td>N</td>\n",
  552.        "      <td>428</td>\n",
  553.        "    </tr>\n",
  554.        "    <tr>\n",
  555.        "      <th>118158</th>\n",
  556.        "      <td>id2824253</td>\n",
  557.        "      <td>1</td>\n",
  558.        "      <td>2016-03-03 08:09:29</td>\n",
  559.        "      <td>2016-03-03 09:04:10</td>\n",
  560.        "      <td>1</td>\n",
  561.        "      <td>-73.961922</td>\n",
  562.        "      <td>40.800533</td>\n",
  563.        "      <td>-74.177269</td>\n",
  564.        "      <td>40.691124</td>\n",
  565.        "      <td>N</td>\n",
  566.        "      <td>3281</td>\n",
  567.        "    </tr>\n",
  568.        "    <tr>\n",
  569.        "      <th>118159</th>\n",
  570.        "      <td>id1333654</td>\n",
  571.        "      <td>1</td>\n",
  572.        "      <td>2016-03-05 01:22:46</td>\n",
  573.        "      <td>2016-03-05 01:34:27</td>\n",
  574.        "      <td>1</td>\n",
  575.        "      <td>-73.973228</td>\n",
  576.        "      <td>40.792824</td>\n",
  577.        "      <td>-73.945877</td>\n",
  578.        "      <td>40.777721</td>\n",
  579.        "      <td>N</td>\n",
  580.        "      <td>701</td>\n",
  581.        "    </tr>\n",
  582.        "    <tr>\n",
  583.        "      <th>118160</th>\n",
  584.        "      <td>id2731206</td>\n",
  585.        "      <td>1</td>\n",
  586.        "      <td>2016-03-13 20:14:32</td>\n",
  587.        "      <td>2016-03-13 20:23:39</td>\n",
  588.        "      <td>1</td>\n",
  589.        "      <td>-73.981178</td>\n",
  590.        "      <td>40.753674</td>\n",
  591.        "      <td>-74.004509</td>\n",
  592.        "      <td>40.747082</td>\n",
  593.        "      <td>N</td>\n",
  594.        "      <td>547</td>\n",
  595.        "    </tr>\n",
  596.        "    <tr>\n",
  597.        "      <th>118161</th>\n",
  598.        "      <td>id2838932</td>\n",
  599.        "      <td>1</td>\n",
  600.        "      <td>2016-03-13 17:03:03</td>\n",
  601.        "      <td>2016-03-13 17:11:10</td>\n",
  602.        "      <td>1</td>\n",
  603.        "      <td>-73.998634</td>\n",
  604.        "      <td>40.726131</td>\n",
  605.        "      <td>-73.985001</td>\n",
  606.        "      <td>40.727985</td>\n",
  607.        "      <td>N</td>\n",
  608.        "      <td>487</td>\n",
  609.        "    </tr>\n",
  610.        "    <tr>\n",
  611.        "      <th>118162</th>\n",
  612.        "      <td>id1486744</td>\n",
  613.        "      <td>2</td>\n",
  614.        "      <td>2016-03-09 10:45:19</td>\n",
  615.        "      <td>2016-03-09 11:18:58</td>\n",
  616.        "      <td>1</td>\n",
  617.        "      <td>-73.982903</td>\n",
  618.        "      <td>40.765659</td>\n",
  619.        "      <td>-73.872917</td>\n",
  620.        "      <td>40.774441</td>\n",
  621.        "      <td>N</td>\n",
  622.        "      <td>2019</td>\n",
  623.        "    </tr>\n",
  624.        "    <tr>\n",
  625.        "      <th>118163</th>\n",
  626.        "      <td>id0042357</td>\n",
  627.        "      <td>2</td>\n",
  628.        "      <td>2016-03-10 20:56:32</td>\n",
  629.        "      <td>2016-03-10 21:09:55</td>\n",
  630.        "      <td>1</td>\n",
  631.        "      <td>-73.993996</td>\n",
  632.        "      <td>40.741283</td>\n",
  633.        "      <td>-73.973114</td>\n",
  634.        "      <td>40.757057</td>\n",
  635.        "      <td>N</td>\n",
  636.        "      <td>803</td>\n",
  637.        "    </tr>\n",
  638.        "    <tr>\n",
  639.        "      <th>118164</th>\n",
  640.        "      <td>id3542490</td>\n",
  641.        "      <td>2</td>\n",
  642.        "      <td>2016-03-07 21:35:25</td>\n",
  643.        "      <td>2016-03-07 21:47:42</td>\n",
  644.        "      <td>1</td>\n",
  645.        "      <td>-73.996368</td>\n",
  646.        "      <td>40.723660</td>\n",
  647.        "      <td>-73.975166</td>\n",
  648.        "      <td>40.689621</td>\n",
  649.        "      <td>N</td>\n",
  650.        "      <td>737</td>\n",
  651.        "    </tr>\n",
  652.        "    <tr>\n",
  653.        "      <th>118165</th>\n",
  654.        "      <td>id0998702</td>\n",
  655.        "      <td>2</td>\n",
  656.        "      <td>2016-03-06 02:15:18</td>\n",
  657.        "      <td>2016-03-06 02:24:16</td>\n",
  658.        "      <td>1</td>\n",
  659.        "      <td>-73.963203</td>\n",
  660.        "      <td>40.671833</td>\n",
  661.        "      <td>-73.960808</td>\n",
  662.        "      <td>40.648785</td>\n",
  663.        "      <td>N</td>\n",
  664.        "      <td>538</td>\n",
  665.        "    </tr>\n",
  666.        "    <tr>\n",
  667.        "      <th>118166</th>\n",
  668.        "      <td>id0480063</td>\n",
  669.        "      <td>1</td>\n",
  670.        "      <td>2016-03-05 12:53:30</td>\n",
  671.        "      <td>2016-03-05 12:57:32</td>\n",
  672.        "      <td>1</td>\n",
  673.        "      <td>-73.976250</td>\n",
  674.        "      <td>40.728737</td>\n",
  675.        "      <td>-73.989166</td>\n",
  676.        "      <td>40.734058</td>\n",
  677.        "      <td>N</td>\n",
  678.        "      <td>242</td>\n",
  679.        "    </tr>\n",
  680.        "    <tr>\n",
  681.        "      <th>118167</th>\n",
  682.        "      <td>id2034624</td>\n",
  683.        "      <td>2</td>\n",
  684.        "      <td>2016-03-12 20:01:27</td>\n",
  685.        "      <td>2016-03-12 20:36:01</td>\n",
  686.        "      <td>5</td>\n",
  687.        "      <td>-73.781212</td>\n",
  688.        "      <td>40.644951</td>\n",
  689.        "      <td>-73.977303</td>\n",
  690.        "      <td>40.750721</td>\n",
  691.        "      <td>N</td>\n",
  692.        "      <td>2074</td>\n",
  693.        "    </tr>\n",
  694.        "    <tr>\n",
  695.        "      <th>118168</th>\n",
  696.        "      <td>id1203726</td>\n",
  697.        "      <td>2</td>\n",
  698.        "      <td>2016-03-03 17:19:23</td>\n",
  699.        "      <td>2016-03-03 17:27:35</td>\n",
  700.        "      <td>2</td>\n",
  701.        "      <td>-73.991798</td>\n",
  702.        "      <td>40.749840</td>\n",
  703.        "      <td>-73.993942</td>\n",
  704.        "      <td>40.735722</td>\n",
  705.        "      <td>N</td>\n",
  706.        "      <td>492</td>\n",
  707.        "    </tr>\n",
  708.        "    <tr>\n",
  709.        "      <th>118169</th>\n",
  710.        "      <td>id3860980</td>\n",
  711.        "      <td>2</td>\n",
  712.        "      <td>2016-03-11 23:59:25</td>\n",
  713.        "      <td>2016-03-12 00:10:12</td>\n",
  714.        "      <td>1</td>\n",
  715.        "      <td>-73.971542</td>\n",
  716.        "      <td>40.757721</td>\n",
  717.        "      <td>-73.991043</td>\n",
  718.        "      <td>40.750568</td>\n",
  719.        "      <td>N</td>\n",
  720.        "      <td>647</td>\n",
  721.        "    </tr>\n",
  722.        "    <tr>\n",
  723.        "      <th>118170</th>\n",
  724.        "      <td>id2924763</td>\n",
  725.        "      <td>2</td>\n",
  726.        "      <td>2016-03-04 23:24:33</td>\n",
  727.        "      <td>2016-03-04 23:31:02</td>\n",
  728.        "      <td>1</td>\n",
  729.        "      <td>-73.997643</td>\n",
  730.        "      <td>40.756622</td>\n",
  731.        "      <td>-73.984688</td>\n",
  732.        "      <td>40.761581</td>\n",
  733.        "      <td>N</td>\n",
  734.        "      <td>389</td>\n",
  735.        "    </tr>\n",
  736.        "    <tr>\n",
  737.        "      <th>118171</th>\n",
  738.        "      <td>id0873910</td>\n",
  739.        "      <td>1</td>\n",
  740.        "      <td>2016-03-10 12:12:01</td>\n",
  741.        "      <td>2016-03-10 12:25:52</td>\n",
  742.        "      <td>2</td>\n",
  743.        "      <td>-73.973885</td>\n",
  744.        "      <td>40.764061</td>\n",
  745.        "      <td>-73.990173</td>\n",
  746.        "      <td>40.741711</td>\n",
  747.        "      <td>N</td>\n",
  748.        "      <td>831</td>\n",
  749.        "    </tr>\n",
  750.        "    <tr>\n",
  751.        "      <th>118172</th>\n",
  752.        "      <td>id1250471</td>\n",
  753.        "      <td>1</td>\n",
  754.        "      <td>2016-03-04 12:21:19</td>\n",
  755.        "      <td>2016-03-04 12:37:49</td>\n",
  756.        "      <td>1</td>\n",
  757.        "      <td>-73.972527</td>\n",
  758.        "      <td>40.758957</td>\n",
  759.        "      <td>-73.956093</td>\n",
  760.        "      <td>40.785572</td>\n",
  761.        "      <td>N</td>\n",
  762.        "      <td>990</td>\n",
  763.        "    </tr>\n",
  764.        "    <tr>\n",
  765.        "      <th>118173</th>\n",
  766.        "      <td>id1192201</td>\n",
  767.        "      <td>1</td>\n",
  768.        "      <td>2016-03-05 03:56:36</td>\n",
  769.        "      <td>2016-03-05 04:05:39</td>\n",
  770.        "      <td>1</td>\n",
  771.        "      <td>-73.988785</td>\n",
  772.        "      <td>40.727390</td>\n",
  773.        "      <td>-73.999474</td>\n",
  774.        "      <td>40.744106</td>\n",
  775.        "      <td>N</td>\n",
  776.        "      <td>543</td>\n",
  777.        "    </tr>\n",
  778.        "    <tr>\n",
  779.        "      <th>118174</th>\n",
  780.        "      <td>id3453691</td>\n",
  781.        "      <td>2</td>\n",
  782.        "      <td>2016-03-07 18:11:54</td>\n",
  783.        "      <td>2016-03-07 18:29:09</td>\n",
  784.        "      <td>1</td>\n",
  785.        "      <td>-74.006531</td>\n",
  786.        "      <td>40.738232</td>\n",
  787.        "      <td>-73.985970</td>\n",
  788.        "      <td>40.726978</td>\n",
  789.        "      <td>N</td>\n",
  790.        "      <td>1035</td>\n",
  791.        "    </tr>\n",
  792.        "    <tr>\n",
  793.        "      <th>118175</th>\n",
  794.        "      <td>id2086152</td>\n",
  795.        "      <td>1</td>\n",
  796.        "      <td>2016-03-11 00:22:18</td>\n",
  797.        "      <td>2016-03-11 00:29:14</td>\n",
  798.        "      <td>2</td>\n",
  799.        "      <td>-73.986481</td>\n",
  800.        "      <td>40.725826</td>\n",
  801.        "      <td>-73.987297</td>\n",
  802.        "      <td>40.736004</td>\n",
  803.        "      <td>N</td>\n",
  804.        "      <td>416</td>\n",
  805.        "    </tr>\n",
  806.        "    <tr>\n",
  807.        "      <th>118176</th>\n",
  808.        "      <td>id2525150</td>\n",
  809.        "      <td>1</td>\n",
  810.        "      <td>2016-03-08 12:56:58</td>\n",
  811.        "      <td>2016-03-08 13:20:07</td>\n",
  812.        "      <td>1</td>\n",
  813.        "      <td>-73.978241</td>\n",
  814.        "      <td>40.744911</td>\n",
  815.        "      <td>-73.870483</td>\n",
  816.        "      <td>40.773777</td>\n",
  817.        "      <td>N</td>\n",
  818.        "      <td>1389</td>\n",
  819.        "    </tr>\n",
  820.        "    <tr>\n",
  821.        "      <th>118177</th>\n",
  822.        "      <td>id3780824</td>\n",
  823.        "      <td>2</td>\n",
  824.        "      <td>2016-03-12 01:08:45</td>\n",
  825.        "      <td>2016-03-12 01:23:02</td>\n",
  826.        "      <td>5</td>\n",
  827.        "      <td>-73.991463</td>\n",
  828.        "      <td>40.719189</td>\n",
  829.        "      <td>-73.949112</td>\n",
  830.        "      <td>40.711090</td>\n",
  831.        "      <td>N</td>\n",
  832.        "      <td>857</td>\n",
  833.        "    </tr>\n",
  834.        "    <tr>\n",
  835.        "      <th>118178</th>\n",
  836.        "      <td>id2669138</td>\n",
  837.        "      <td>2</td>\n",
  838.        "      <td>2016-03-05 09:41:26</td>\n",
  839.        "      <td>2016-03-05 09:52:15</td>\n",
  840.        "      <td>6</td>\n",
  841.        "      <td>-73.968597</td>\n",
  842.        "      <td>40.786320</td>\n",
  843.        "      <td>-73.981667</td>\n",
  844.        "      <td>40.754440</td>\n",
  845.        "      <td>N</td>\n",
  846.        "      <td>649</td>\n",
  847.        "    </tr>\n",
  848.        "    <tr>\n",
  849.        "      <th>118179</th>\n",
  850.        "      <td>id3087596</td>\n",
  851.        "      <td>2</td>\n",
  852.        "      <td>2016-03-13 15:25:46</td>\n",
  853.        "      <td>2016-03-13 15:34:52</td>\n",
  854.        "      <td>2</td>\n",
  855.        "      <td>-73.998871</td>\n",
  856.        "      <td>40.724781</td>\n",
  857.        "      <td>-73.983299</td>\n",
  858.        "      <td>40.743511</td>\n",
  859.        "      <td>N</td>\n",
  860.        "      <td>546</td>\n",
  861.        "    </tr>\n",
  862.        "    <tr>\n",
  863.        "      <th>118180</th>\n",
  864.        "      <td>id3274818</td>\n",
  865.        "      <td>2</td>\n",
  866.        "      <td>2016-03-11 21:04:31</td>\n",
  867.        "      <td>2016-03-11 21:08:41</td>\n",
  868.        "      <td>2</td>\n",
  869.        "      <td>-73.978233</td>\n",
  870.        "      <td>40.763203</td>\n",
  871.        "      <td>-73.982498</td>\n",
  872.        "      <td>40.766701</td>\n",
  873.        "      <td>N</td>\n",
  874.        "      <td>250</td>\n",
  875.        "    </tr>\n",
  876.        "    <tr>\n",
  877.        "      <th>118181</th>\n",
  878.        "      <td>id2224211</td>\n",
  879.        "      <td>1</td>\n",
  880.        "      <td>2016-03-06 10:42:32</td>\n",
  881.        "      <td>2016-03-06 10:46:57</td>\n",
  882.        "      <td>1</td>\n",
  883.        "      <td>-73.987488</td>\n",
  884.        "      <td>40.768585</td>\n",
  885.        "      <td>-73.979660</td>\n",
  886.        "      <td>40.759151</td>\n",
  887.        "      <td>N</td>\n",
  888.        "      <td>265</td>\n",
  889.        "    </tr>\n",
  890.        "    <tr>\n",
  891.        "      <th>118182</th>\n",
  892.        "      <td>id3537077</td>\n",
  893.        "      <td>2</td>\n",
  894.        "      <td>2016-03-11 23:48:13</td>\n",
  895.        "      <td>2016-03-12 00:01:36</td>\n",
  896.        "      <td>1</td>\n",
  897.        "      <td>-73.992729</td>\n",
  898.        "      <td>40.752811</td>\n",
  899.        "      <td>-73.987862</td>\n",
  900.        "      <td>40.731930</td>\n",
  901.        "      <td>N</td>\n",
  902.        "      <td>803</td>\n",
  903.        "    </tr>\n",
  904.        "    <tr>\n",
  905.        "      <th>118183</th>\n",
  906.        "      <td>id3482902</td>\n",
  907.        "      <td>1</td>\n",
  908.        "      <td>2016-03-01 07:21:04</td>\n",
  909.        "      <td>2016-03-01 07:23:36</td>\n",
  910.        "      <td>1</td>\n",
  911.        "      <td>-73.974693</td>\n",
  912.        "      <td>40.756088</td>\n",
  913.        "      <td>-73.969971</td>\n",
  914.        "      <td>40.762115</td>\n",
  915.        "      <td>N</td>\n",
  916.        "      <td>152</td>\n",
  917.        "    </tr>\n",
  918.        "    <tr>\n",
  919.        "      <th>118184</th>\n",
  920.        "      <td>id0469946</td>\n",
  921.        "      <td>2</td>\n",
  922.        "      <td>2016-03-06 11:04:48</td>\n",
  923.        "      <td>2016-03-06 11:17:45</td>\n",
  924.        "      <td>2</td>\n",
  925.        "      <td>-74.015572</td>\n",
  926.        "      <td>40.710892</td>\n",
  927.        "      <td>-73.996620</td>\n",
  928.        "      <td>40.743633</td>\n",
  929.        "      <td>N</td>\n",
  930.        "      <td>777</td>\n",
  931.        "    </tr>\n",
  932.        "  </tbody>\n",
  933.        "</table>\n",
  934.        "<p>118185 rows × 11 columns</p>\n",
  935.        "</div>"
  936.       ],
  937.       "text/plain": [
  938.        "               id  vendor_id      pickup_datetime     dropoff_datetime  \\\n",
  939.        "0       id2875421          2  2016-03-14 17:24:55  2016-03-14 17:32:30   \n",
  940.        "1       id0012891          2  2016-03-10 21:45:01  2016-03-10 22:05:26   \n",
  941.        "2       id3361153          1  2016-03-11 07:11:23  2016-03-11 07:20:09   \n",
  942.        "3       id2129090          1  2016-03-14 14:05:39  2016-03-14 14:28:05   \n",
  943.        "4       id0256505          1  2016-03-14 15:04:38  2016-03-14 15:16:13   \n",
  944.        "5       id0970832          1  2016-03-12 20:39:39  2016-03-12 21:05:40   \n",
  945.        "6       id2049424          2  2016-03-02 20:15:07  2016-03-02 20:37:43   \n",
  946.        "7       id0038484          2  2016-03-09 13:41:11  2016-03-09 13:53:27   \n",
  947.        "8       id3092788          2  2016-03-03 22:01:32  2016-03-03 22:17:44   \n",
  948.        "9       id3863815          2  2016-03-14 04:24:36  2016-03-14 04:37:11   \n",
  949.        "10      id1832737          2  2016-03-06 10:53:26  2016-03-06 10:59:30   \n",
  950.        "11      id2718231          1  2016-03-08 02:44:19  2016-03-08 03:04:35   \n",
  951.        "12      id3956459          2  2016-03-05 10:23:45  2016-03-05 10:45:52   \n",
  952.        "13      id2393811          1  2016-03-10 18:52:40  2016-03-10 19:08:43   \n",
  953.        "14      id2808378          1  2016-03-09 17:11:16  2016-03-09 17:28:43   \n",
  954.        "15      id1295254          1  2016-03-06 11:01:27  2016-03-06 11:08:29   \n",
  955.        "16      id1660823          2  2016-03-01 06:40:18  2016-03-01 07:01:37   \n",
  956.        "17      id0802391          1  2016-03-06 17:44:45  2016-03-06 17:52:14   \n",
  957.        "18      id2268459          1  2016-03-02 07:02:21  2016-03-02 07:24:57   \n",
  958.        "19      id2797773          1  2016-03-08 08:33:35  2016-03-08 08:36:35   \n",
  959.        "20      id3817493          2  2016-03-14 14:57:56  2016-03-14 15:15:26   \n",
  960.        "21      id1971518          1  2016-03-12 13:04:28  2016-03-12 13:14:33   \n",
  961.        "22      id3911487          1  2016-03-03 17:56:45  2016-03-03 18:05:28   \n",
  962.        "23      id3276198          2  2016-03-14 20:31:12  2016-03-14 20:36:18   \n",
  963.        "24      id1527676          1  2016-03-07 19:38:25  2016-03-07 19:54:35   \n",
  964.        "25      id1146853          2  2016-03-05 02:59:30  2016-03-05 03:20:50   \n",
  965.        "26      id3714906          1  2016-03-01 08:33:57  2016-03-01 08:40:44   \n",
  966.        "27      id1937745          2  2016-03-07 18:51:46  2016-03-07 18:58:30   \n",
  967.        "28      id2672200          1  2016-03-08 10:59:46  2016-03-08 11:21:50   \n",
  968.        "29      id3200728          2  2016-03-03 10:14:57  2016-03-03 10:32:51   \n",
  969.        "...           ...        ...                  ...                  ...   \n",
  970.        "118155  id2073065          2  2016-03-10 21:43:30  2016-03-10 21:50:55   \n",
  971.        "118156  id1042737          2  2016-03-10 06:10:29  2016-03-10 06:13:15   \n",
  972.        "118157  id0538386          1  2016-03-07 18:29:35  2016-03-07 18:36:43   \n",
  973.        "118158  id2824253          1  2016-03-03 08:09:29  2016-03-03 09:04:10   \n",
  974.        "118159  id1333654          1  2016-03-05 01:22:46  2016-03-05 01:34:27   \n",
  975.        "118160  id2731206          1  2016-03-13 20:14:32  2016-03-13 20:23:39   \n",
  976.        "118161  id2838932          1  2016-03-13 17:03:03  2016-03-13 17:11:10   \n",
  977.        "118162  id1486744          2  2016-03-09 10:45:19  2016-03-09 11:18:58   \n",
  978.        "118163  id0042357          2  2016-03-10 20:56:32  2016-03-10 21:09:55   \n",
  979.        "118164  id3542490          2  2016-03-07 21:35:25  2016-03-07 21:47:42   \n",
  980.        "118165  id0998702          2  2016-03-06 02:15:18  2016-03-06 02:24:16   \n",
  981.        "118166  id0480063          1  2016-03-05 12:53:30  2016-03-05 12:57:32   \n",
  982.        "118167  id2034624          2  2016-03-12 20:01:27  2016-03-12 20:36:01   \n",
  983.        "118168  id1203726          2  2016-03-03 17:19:23  2016-03-03 17:27:35   \n",
  984.        "118169  id3860980          2  2016-03-11 23:59:25  2016-03-12 00:10:12   \n",
  985.        "118170  id2924763          2  2016-03-04 23:24:33  2016-03-04 23:31:02   \n",
  986.        "118171  id0873910          1  2016-03-10 12:12:01  2016-03-10 12:25:52   \n",
  987.        "118172  id1250471          1  2016-03-04 12:21:19  2016-03-04 12:37:49   \n",
  988.        "118173  id1192201          1  2016-03-05 03:56:36  2016-03-05 04:05:39   \n",
  989.        "118174  id3453691          2  2016-03-07 18:11:54  2016-03-07 18:29:09   \n",
  990.        "118175  id2086152          1  2016-03-11 00:22:18  2016-03-11 00:29:14   \n",
  991.        "118176  id2525150          1  2016-03-08 12:56:58  2016-03-08 13:20:07   \n",
  992.        "118177  id3780824          2  2016-03-12 01:08:45  2016-03-12 01:23:02   \n",
  993.        "118178  id2669138          2  2016-03-05 09:41:26  2016-03-05 09:52:15   \n",
  994.        "118179  id3087596          2  2016-03-13 15:25:46  2016-03-13 15:34:52   \n",
  995.        "118180  id3274818          2  2016-03-11 21:04:31  2016-03-11 21:08:41   \n",
  996.        "118181  id2224211          1  2016-03-06 10:42:32  2016-03-06 10:46:57   \n",
  997.        "118182  id3537077          2  2016-03-11 23:48:13  2016-03-12 00:01:36   \n",
  998.        "118183  id3482902          1  2016-03-01 07:21:04  2016-03-01 07:23:36   \n",
  999.        "118184  id0469946          2  2016-03-06 11:04:48  2016-03-06 11:17:45   \n",
  1000.        "\n",
  1001.        "        passenger_count  pickup_longitude  pickup_latitude  dropoff_longitude  \\\n",
  1002.        "0                     1        -73.982155        40.767937         -73.964630   \n",
  1003.        "1                     1        -73.981049        40.744339         -73.973000   \n",
  1004.        "2                     1        -73.994560        40.750526         -73.978500   \n",
  1005.        "3                     1        -73.975090        40.758766         -73.953201   \n",
  1006.        "4                     1        -73.994484        40.745087         -73.998993   \n",
  1007.        "5                     1        -74.008247        40.747353         -73.979446   \n",
  1008.        "6                     1        -73.963890        40.773651         -74.005112   \n",
  1009.        "7                     2        -73.972855        40.764400         -73.971809   \n",
  1010.        "8                     2        -73.984772        40.710571         -73.989410   \n",
  1011.        "9                     3        -73.944359        40.714489         -73.910530   \n",
  1012.        "10                    1        -73.984711        40.760181         -73.979561   \n",
  1013.        "11                    1        -73.992500        40.740444         -73.840111   \n",
  1014.        "12                    1        -73.986908        40.761608         -74.008408   \n",
  1015.        "13                    1        -73.970581        40.799046         -73.989815   \n",
  1016.        "14                    1        -73.978645        40.740932         -74.012695   \n",
  1017.        "15                    1        -73.975983        40.757748         -73.982162   \n",
  1018.        "16                    5        -73.982140        40.775326         -74.009850   \n",
  1019.        "17                    1        -73.997208        40.724072         -74.000618   \n",
  1020.        "18                    1        -73.985359        40.738411         -73.870422   \n",
  1021.        "19                    1        -73.967133        40.793465         -73.970390   \n",
  1022.        "20                    1        -73.952881        40.766468         -73.978630   \n",
  1023.        "21                    1        -73.988976        40.759205         -73.973991   \n",
  1024.        "22                    1        -73.962112        40.776100         -73.968521   \n",
  1025.        "23                    1        -73.981911        40.766880         -73.982597   \n",
  1026.        "24                    2        -73.986130        40.759720         -74.001488   \n",
  1027.        "25                    4        -74.005394        40.740810         -73.950630   \n",
  1028.        "26                    1        -73.989494        40.753677         -73.988335   \n",
  1029.        "27                    2        -73.990974        40.760632         -73.994720   \n",
  1030.        "28                    1        -73.964325        40.773594         -73.989769   \n",
  1031.        "29                    1        -73.995880        40.759190         -73.979874   \n",
  1032.        "...                 ...               ...              ...                ...   \n",
  1033.        "118155                1        -73.989738        40.756599         -74.005318   \n",
  1034.        "118156                1        -73.985954        40.752129         -73.978592   \n",
  1035.        "118157                1        -73.976997        40.755756         -73.990540   \n",
  1036.        "118158                1        -73.961922        40.800533         -74.177269   \n",
  1037.        "118159                1        -73.973228        40.792824         -73.945877   \n",
  1038.        "118160                1        -73.981178        40.753674         -74.004509   \n",
  1039.        "118161                1        -73.998634        40.726131         -73.985001   \n",
  1040.        "118162                1        -73.982903        40.765659         -73.872917   \n",
  1041.        "118163                1        -73.993996        40.741283         -73.973114   \n",
  1042.        "118164                1        -73.996368        40.723660         -73.975166   \n",
  1043.        "118165                1        -73.963203        40.671833         -73.960808   \n",
  1044.        "118166                1        -73.976250        40.728737         -73.989166   \n",
  1045.        "118167                5        -73.781212        40.644951         -73.977303   \n",
  1046.        "118168                2        -73.991798        40.749840         -73.993942   \n",
  1047.        "118169                1        -73.971542        40.757721         -73.991043   \n",
  1048.        "118170                1        -73.997643        40.756622         -73.984688   \n",
  1049.        "118171                2        -73.973885        40.764061         -73.990173   \n",
  1050.        "118172                1        -73.972527        40.758957         -73.956093   \n",
  1051.        "118173                1        -73.988785        40.727390         -73.999474   \n",
  1052.        "118174                1        -74.006531        40.738232         -73.985970   \n",
  1053.        "118175                2        -73.986481        40.725826         -73.987297   \n",
  1054.        "118176                1        -73.978241        40.744911         -73.870483   \n",
  1055.        "118177                5        -73.991463        40.719189         -73.949112   \n",
  1056.        "118178                6        -73.968597        40.786320         -73.981667   \n",
  1057.        "118179                2        -73.998871        40.724781         -73.983299   \n",
  1058.        "118180                2        -73.978233        40.763203         -73.982498   \n",
  1059.        "118181                1        -73.987488        40.768585         -73.979660   \n",
  1060.        "118182                1        -73.992729        40.752811         -73.987862   \n",
  1061.        "118183                1        -73.974693        40.756088         -73.969971   \n",
  1062.        "118184                2        -74.015572        40.710892         -73.996620   \n",
  1063.        "\n",
  1064.        "        dropoff_latitude store_and_fwd_flag  trip_duration  \n",
  1065.        "0              40.765602                  N            455  \n",
  1066.        "1              40.789989                  N           1225  \n",
  1067.        "2              40.756191                  N            526  \n",
  1068.        "3              40.765068                  N           1346  \n",
  1069.        "4              40.722710                  N            695  \n",
  1070.        "5              40.718750                  N           1561  \n",
  1071.        "6              40.751492                  N           1356  \n",
  1072.        "7              40.757889                  N            736  \n",
  1073.        "8              40.730148                  N            972  \n",
  1074.        "9              40.709492                  N            755  \n",
  1075.        "10             40.752705                  N            364  \n",
  1076.        "11             40.719517                  N           1216  \n",
  1077.        "12             40.711620                  N           1327  \n",
  1078.        "13             40.767246                  N            963  \n",
  1079.        "14             40.701588                  N           1047  \n",
  1080.        "15             40.740749                  N            422  \n",
  1081.        "16             40.721699                  N           1279  \n",
  1082.        "17             40.732155                  N            449  \n",
  1083.        "18             40.773682                  N           1356  \n",
  1084.        "19             40.795750                  N            180  \n",
  1085.        "20             40.761921                  N           1050  \n",
  1086.        "21             40.760590                  N            605  \n",
  1087.        "22             40.764408                  N            523  \n",
  1088.        "23             40.777180                  N            306  \n",
  1089.        "24             40.736065                  N            970  \n",
  1090.        "25             40.821037                  N           1280  \n",
  1091.        "26             40.745949                  N            407  \n",
  1092.        "27             40.750450                  N            404  \n",
  1093.        "28             40.738483                  N           1324  \n",
  1094.        "29             40.752781                  N           1074  \n",
  1095.        "...                  ...                ...            ...  \n",
  1096.        "118155         40.740231                  N            445  \n",
  1097.        "118156         40.752602                  N            166  \n",
  1098.        "118157         40.751163                  N            428  \n",
  1099.        "118158         40.691124                  N           3281  \n",
  1100.        "118159         40.777721                  N            701  \n",
  1101.        "118160         40.747082                  N            547  \n",
  1102.        "118161         40.727985                  N            487  \n",
  1103.        "118162         40.774441                  N           2019  \n",
  1104.        "118163         40.757057                  N            803  \n",
  1105.        "118164         40.689621                  N            737  \n",
  1106.        "118165         40.648785                  N            538  \n",
  1107.        "118166         40.734058                  N            242  \n",
  1108.        "118167         40.750721                  N           2074  \n",
  1109.        "118168         40.735722                  N            492  \n",
  1110.        "118169         40.750568                  N            647  \n",
  1111.        "118170         40.761581                  N            389  \n",
  1112.        "118171         40.741711                  N            831  \n",
  1113.        "118172         40.785572                  N            990  \n",
  1114.        "118173         40.744106                  N            543  \n",
  1115.        "118174         40.726978                  N           1035  \n",
  1116.        "118175         40.736004                  N            416  \n",
  1117.        "118176         40.773777                  N           1389  \n",
  1118.        "118177         40.711090                  N            857  \n",
  1119.        "118178         40.754440                  N            649  \n",
  1120.        "118179         40.743511                  N            546  \n",
  1121.        "118180         40.766701                  N            250  \n",
  1122.        "118181         40.759151                  N            265  \n",
  1123.        "118182         40.731930                  N            803  \n",
  1124.        "118183         40.762115                  N            152  \n",
  1125.        "118184         40.743633                  N            777  \n",
  1126.        "\n",
  1127.        "[118185 rows x 11 columns]"
  1128.       ]
  1129.      },
  1130.      "execution_count": 589,
  1131.      "metadata": {},
  1132.      "output_type": "execute_result"
  1133.     }
  1134.    ],
  1135.    "source": [
  1136.     "data = pd.DataFrame(C)\n",
  1137.     "data"
  1138.    ]
  1139.   },
  1140.   {
  1141.    "cell_type": "code",
  1142.    "execution_count": 590,
  1143.    "metadata": {},
  1144.    "outputs": [
  1145.     {
  1146.      "data": {
  1147.       "text/plain": [
  1148.        "(118185, 11)"
  1149.       ]
  1150.      },
  1151.      "execution_count": 590,
  1152.      "metadata": {},
  1153.      "output_type": "execute_result"
  1154.     }
  1155.    ],
  1156.    "source": [
  1157.     "data.shape"
  1158.    ]
  1159.   },
  1160.   {
  1161.    "cell_type": "code",
  1162.    "execution_count": 591,
  1163.    "metadata": {},
  1164.    "outputs": [
  1165.     {
  1166.      "data": {
  1167.       "text/plain": [
  1168.        "id                     object\n",
  1169.        "vendor_id               int64\n",
  1170.        "pickup_datetime        object\n",
  1171.        "dropoff_datetime       object\n",
  1172.        "passenger_count         int64\n",
  1173.        "pickup_longitude      float64\n",
  1174.        "pickup_latitude       float64\n",
  1175.        "dropoff_longitude     float64\n",
  1176.        "dropoff_latitude      float64\n",
  1177.        "store_and_fwd_flag     object\n",
  1178.        "trip_duration           int64\n",
  1179.        "dtype: object"
  1180.       ]
  1181.      },
  1182.      "execution_count": 591,
  1183.      "metadata": {},
  1184.      "output_type": "execute_result"
  1185.     }
  1186.    ],
  1187.    "source": [
  1188.     "data.dtypes"
  1189.    ]
  1190.   },
  1191.   {
  1192.    "cell_type": "code",
  1193.    "execution_count": 592,
  1194.    "metadata": {},
  1195.    "outputs": [
  1196.     {
  1197.      "data": {
  1198.       "text/html": [
  1199.        "<div>\n",
  1200.        "<style scoped>\n",
  1201.        "    .dataframe tbody tr th:only-of-type {\n",
  1202.        "        vertical-align: middle;\n",
  1203.        "    }\n",
  1204.        "\n",
  1205.        "    .dataframe tbody tr th {\n",
  1206.        "        vertical-align: top;\n",
  1207.        "    }\n",
  1208.        "\n",
  1209.        "    .dataframe thead th {\n",
  1210.        "        text-align: right;\n",
  1211.        "    }\n",
  1212.        "</style>\n",
  1213.        "<table border=\"1\" class=\"dataframe\">\n",
  1214.        "  <thead>\n",
  1215.        "    <tr style=\"text-align: right;\">\n",
  1216.        "      <th></th>\n",
  1217.        "      <th>vendor_id</th>\n",
  1218.        "      <th>passenger_count</th>\n",
  1219.        "      <th>pickup_longitude</th>\n",
  1220.        "      <th>pickup_latitude</th>\n",
  1221.        "      <th>dropoff_longitude</th>\n",
  1222.        "      <th>dropoff_latitude</th>\n",
  1223.        "      <th>trip_duration</th>\n",
  1224.        "    </tr>\n",
  1225.        "  </thead>\n",
  1226.        "  <tbody>\n",
  1227.        "    <tr>\n",
  1228.        "      <th>count</th>\n",
  1229.        "      <td>118185.000000</td>\n",
  1230.        "      <td>118185.000000</td>\n",
  1231.        "      <td>118185.000000</td>\n",
  1232.        "      <td>118185.000000</td>\n",
  1233.        "      <td>118185.000000</td>\n",
  1234.        "      <td>118185.000000</td>\n",
  1235.        "      <td>118185.000000</td>\n",
  1236.        "    </tr>\n",
  1237.        "    <tr>\n",
  1238.        "      <th>mean</th>\n",
  1239.        "      <td>1.534958</td>\n",
  1240.        "      <td>1.657148</td>\n",
  1241.        "      <td>-73.973971</td>\n",
  1242.        "      <td>40.751392</td>\n",
  1243.        "      <td>-73.973538</td>\n",
  1244.        "      <td>40.752212</td>\n",
  1245.        "      <td>927.186310</td>\n",
  1246.        "    </tr>\n",
  1247.        "    <tr>\n",
  1248.        "      <th>std</th>\n",
  1249.        "      <td>0.498779</td>\n",
  1250.        "      <td>1.313844</td>\n",
  1251.        "      <td>0.040456</td>\n",
  1252.        "      <td>0.027958</td>\n",
  1253.        "      <td>0.039192</td>\n",
  1254.        "      <td>0.032284</td>\n",
  1255.        "      <td>3118.710246</td>\n",
  1256.        "    </tr>\n",
  1257.        "    <tr>\n",
  1258.        "      <th>min</th>\n",
  1259.        "      <td>1.000000</td>\n",
  1260.        "      <td>0.000000</td>\n",
  1261.        "      <td>-79.487900</td>\n",
  1262.        "      <td>40.225803</td>\n",
  1263.        "      <td>-79.487900</td>\n",
  1264.        "      <td>40.225800</td>\n",
  1265.        "      <td>1.000000</td>\n",
  1266.        "    </tr>\n",
  1267.        "    <tr>\n",
  1268.        "      <th>25%</th>\n",
  1269.        "      <td>1.000000</td>\n",
  1270.        "      <td>1.000000</td>\n",
  1271.        "      <td>-73.991875</td>\n",
  1272.        "      <td>40.737835</td>\n",
  1273.        "      <td>-73.991394</td>\n",
  1274.        "      <td>40.736462</td>\n",
  1275.        "      <td>393.000000</td>\n",
  1276.        "    </tr>\n",
  1277.        "    <tr>\n",
  1278.        "      <th>50%</th>\n",
  1279.        "      <td>2.000000</td>\n",
  1280.        "      <td>1.000000</td>\n",
  1281.        "      <td>-73.981796</td>\n",
  1282.        "      <td>40.754501</td>\n",
  1283.        "      <td>-73.979759</td>\n",
  1284.        "      <td>40.754848</td>\n",
  1285.        "      <td>652.000000</td>\n",
  1286.        "    </tr>\n",
  1287.        "    <tr>\n",
  1288.        "      <th>75%</th>\n",
  1289.        "      <td>2.000000</td>\n",
  1290.        "      <td>2.000000</td>\n",
  1291.        "      <td>-73.967575</td>\n",
  1292.        "      <td>40.768471</td>\n",
  1293.        "      <td>-73.962990</td>\n",
  1294.        "      <td>40.770077</td>\n",
  1295.        "      <td>1048.000000</td>\n",
  1296.        "    </tr>\n",
  1297.        "    <tr>\n",
  1298.        "      <th>max</th>\n",
  1299.        "      <td>2.000000</td>\n",
  1300.        "      <td>6.000000</td>\n",
  1301.        "      <td>-73.425018</td>\n",
  1302.        "      <td>41.292198</td>\n",
  1303.        "      <td>-73.055977</td>\n",
  1304.        "      <td>41.292198</td>\n",
  1305.        "      <td>86366.000000</td>\n",
  1306.        "    </tr>\n",
  1307.        "  </tbody>\n",
  1308.        "</table>\n",
  1309.        "</div>"
  1310.       ],
  1311.       "text/plain": [
  1312.        "           vendor_id  passenger_count  pickup_longitude  pickup_latitude  \\\n",
  1313.        "count  118185.000000    118185.000000     118185.000000    118185.000000   \n",
  1314.        "mean        1.534958         1.657148        -73.973971        40.751392   \n",
  1315.        "std         0.498779         1.313844          0.040456         0.027958   \n",
  1316.        "min         1.000000         0.000000        -79.487900        40.225803   \n",
  1317.        "25%         1.000000         1.000000        -73.991875        40.737835   \n",
  1318.        "50%         2.000000         1.000000        -73.981796        40.754501   \n",
  1319.        "75%         2.000000         2.000000        -73.967575        40.768471   \n",
  1320.        "max         2.000000         6.000000        -73.425018        41.292198   \n",
  1321.        "\n",
  1322.        "       dropoff_longitude  dropoff_latitude  trip_duration  \n",
  1323.        "count      118185.000000     118185.000000  118185.000000  \n",
  1324.        "mean          -73.973538         40.752212     927.186310  \n",
  1325.        "std             0.039192          0.032284    3118.710246  \n",
  1326.        "min           -79.487900         40.225800       1.000000  \n",
  1327.        "25%           -73.991394         40.736462     393.000000  \n",
  1328.        "50%           -73.979759         40.754848     652.000000  \n",
  1329.        "75%           -73.962990         40.770077    1048.000000  \n",
  1330.        "max           -73.055977         41.292198   86366.000000  "
  1331.       ]
  1332.      },
  1333.      "execution_count": 592,
  1334.      "metadata": {},
  1335.      "output_type": "execute_result"
  1336.     }
  1337.    ],
  1338.    "source": [
  1339.     "data.describe()"
  1340.    ]
  1341.   },
  1342.   {
  1343.    "cell_type": "code",
  1344.    "execution_count": 593,
  1345.    "metadata": {},
  1346.    "outputs": [
  1347.     {
  1348.      "name": "stdout",
  1349.      "output_type": "stream",
  1350.      "text": [
  1351.       "<class 'pandas.core.frame.DataFrame'>\n",
  1352.       "RangeIndex: 118185 entries, 0 to 118184\n",
  1353.       "Data columns (total 11 columns):\n",
  1354.       "id                    118185 non-null object\n",
  1355.       "vendor_id             118185 non-null int64\n",
  1356.       "pickup_datetime       118185 non-null object\n",
  1357.       "dropoff_datetime      118185 non-null object\n",
  1358.       "passenger_count       118185 non-null int64\n",
  1359.       "pickup_longitude      118185 non-null float64\n",
  1360.       "pickup_latitude       118185 non-null float64\n",
  1361.       "dropoff_longitude     118185 non-null float64\n",
  1362.       "dropoff_latitude      118185 non-null float64\n",
  1363.       "store_and_fwd_flag    118185 non-null object\n",
  1364.       "trip_duration         118185 non-null int64\n",
  1365.       "dtypes: float64(4), int64(3), object(4)\n",
  1366.       "memory usage: 9.9+ MB\n"
  1367.      ]
  1368.     }
  1369.    ],
  1370.    "source": [
  1371.     "data.info()"
  1372.    ]
  1373.   },
  1374.   {
  1375.    "cell_type": "code",
  1376.    "execution_count": 602,
  1377.    "metadata": {},
  1378.    "outputs": [],
  1379.    "source": [
  1380.     "pickupdist=[]\n",
  1381.     "dropoffdist=[]\n",
  1382.     "for i in range(len(data)):\n",
  1383.     "    coor=(data['pickup_latitude'][i],data['pickup_longitude'][i])\n",
  1384.     "    coor2=(data['dropoff_latitude'][i],data['dropoff_longitude'][i])\n",
  1385.     "    pickupdist.append(coor)\n",
  1386.     "    dropoffdist.append(coor2)\n",
  1387.     "resPick=rg.search(pickupdist)\n",
  1388.     "resDrop=rg.search(dropoffdist)\n",
  1389.     "district_pick = [row['name'] for row in resPick]\n",
  1390.     "district_drop= [row['name'] for row in resDrop]\n",
  1391.     "data['pickup_district'] =district_pick\n",
  1392.     "data['dropoff_district'] =district_drop"
  1393.    ]
  1394.   },
  1395.   {
  1396.    "cell_type": "code",
  1397.    "execution_count": 603,
  1398.    "metadata": {},
  1399.    "outputs": [
  1400.     {
  1401.      "data": {
  1402.       "text/html": [
  1403.        "<div>\n",
  1404.        "<style scoped>\n",
  1405.        "    .dataframe tbody tr th:only-of-type {\n",
  1406.        "        vertical-align: middle;\n",
  1407.        "    }\n",
  1408.        "\n",
  1409.        "    .dataframe tbody tr th {\n",
  1410.        "        vertical-align: top;\n",
  1411.        "    }\n",
  1412.        "\n",
  1413.        "    .dataframe thead th {\n",
  1414.        "        text-align: right;\n",
  1415.        "    }\n",
  1416.        "</style>\n",
  1417.        "<table border=\"1\" class=\"dataframe\">\n",
  1418.        "  <thead>\n",
  1419.        "    <tr style=\"text-align: right;\">\n",
  1420.        "      <th></th>\n",
  1421.        "      <th>id</th>\n",
  1422.        "      <th>vendor_id</th>\n",
  1423.        "      <th>pickup_datetime</th>\n",
  1424.        "      <th>dropoff_datetime</th>\n",
  1425.        "      <th>passenger_count</th>\n",
  1426.        "      <th>pickup_longitude</th>\n",
  1427.        "      <th>pickup_latitude</th>\n",
  1428.        "      <th>dropoff_longitude</th>\n",
  1429.        "      <th>dropoff_latitude</th>\n",
  1430.        "      <th>store_and_fwd_flag</th>\n",
  1431.        "      <th>trip_duration</th>\n",
  1432.        "      <th>pickup_district</th>\n",
  1433.        "      <th>dropoff_district</th>\n",
  1434.        "    </tr>\n",
  1435.        "  </thead>\n",
  1436.        "  <tbody>\n",
  1437.        "    <tr>\n",
  1438.        "      <th>0</th>\n",
  1439.        "      <td>id2875421</td>\n",
  1440.        "      <td>2</td>\n",
  1441.        "      <td>2016-03-14 17:24:55</td>\n",
  1442.        "      <td>2016-03-14 17:32:30</td>\n",
  1443.        "      <td>1</td>\n",
  1444.        "      <td>-73.982155</td>\n",
  1445.        "      <td>40.767937</td>\n",
  1446.        "      <td>-73.964630</td>\n",
  1447.        "      <td>40.765602</td>\n",
  1448.        "      <td>N</td>\n",
  1449.        "      <td>455</td>\n",
  1450.        "      <td>Manhattan</td>\n",
  1451.        "      <td>Manhattan</td>\n",
  1452.        "    </tr>\n",
  1453.        "    <tr>\n",
  1454.        "      <th>1</th>\n",
  1455.        "      <td>id0012891</td>\n",
  1456.        "      <td>2</td>\n",
  1457.        "      <td>2016-03-10 21:45:01</td>\n",
  1458.        "      <td>2016-03-10 22:05:26</td>\n",
  1459.        "      <td>1</td>\n",
  1460.        "      <td>-73.981049</td>\n",
  1461.        "      <td>40.744339</td>\n",
  1462.        "      <td>-73.973000</td>\n",
  1463.        "      <td>40.789989</td>\n",
  1464.        "      <td>N</td>\n",
  1465.        "      <td>1225</td>\n",
  1466.        "      <td>Long Island City</td>\n",
  1467.        "      <td>Manhattan</td>\n",
  1468.        "    </tr>\n",
  1469.        "    <tr>\n",
  1470.        "      <th>2</th>\n",
  1471.        "      <td>id3361153</td>\n",
  1472.        "      <td>1</td>\n",
  1473.        "      <td>2016-03-11 07:11:23</td>\n",
  1474.        "      <td>2016-03-11 07:20:09</td>\n",
  1475.        "      <td>1</td>\n",
  1476.        "      <td>-73.994560</td>\n",
  1477.        "      <td>40.750526</td>\n",
  1478.        "      <td>-73.978500</td>\n",
  1479.        "      <td>40.756191</td>\n",
  1480.        "      <td>N</td>\n",
  1481.        "      <td>526</td>\n",
  1482.        "      <td>Weehawken</td>\n",
  1483.        "      <td>Manhattan</td>\n",
  1484.        "    </tr>\n",
  1485.        "    <tr>\n",
  1486.        "      <th>3</th>\n",
  1487.        "      <td>id2129090</td>\n",
  1488.        "      <td>1</td>\n",
  1489.        "      <td>2016-03-14 14:05:39</td>\n",
  1490.        "      <td>2016-03-14 14:28:05</td>\n",
  1491.        "      <td>1</td>\n",
  1492.        "      <td>-73.975090</td>\n",
  1493.        "      <td>40.758766</td>\n",
  1494.        "      <td>-73.953201</td>\n",
  1495.        "      <td>40.765068</td>\n",
  1496.        "      <td>N</td>\n",
  1497.        "      <td>1346</td>\n",
  1498.        "      <td>Manhattan</td>\n",
  1499.        "      <td>Long Island City</td>\n",
  1500.        "    </tr>\n",
  1501.        "    <tr>\n",
  1502.        "      <th>4</th>\n",
  1503.        "      <td>id0256505</td>\n",
  1504.        "      <td>1</td>\n",
  1505.        "      <td>2016-03-14 15:04:38</td>\n",
  1506.        "      <td>2016-03-14 15:16:13</td>\n",
  1507.        "      <td>1</td>\n",
  1508.        "      <td>-73.994484</td>\n",
  1509.        "      <td>40.745087</td>\n",
  1510.        "      <td>-73.998993</td>\n",
  1511.        "      <td>40.722710</td>\n",
  1512.        "      <td>N</td>\n",
  1513.        "      <td>695</td>\n",
  1514.        "      <td>New York City</td>\n",
  1515.        "      <td>New York City</td>\n",
  1516.        "    </tr>\n",
  1517.        "  </tbody>\n",
  1518.        "</table>\n",
  1519.        "</div>"
  1520.       ],
  1521.       "text/plain": [
  1522.        "          id  vendor_id      pickup_datetime     dropoff_datetime  \\\n",
  1523.        "0  id2875421          2  2016-03-14 17:24:55  2016-03-14 17:32:30   \n",
  1524.        "1  id0012891          2  2016-03-10 21:45:01  2016-03-10 22:05:26   \n",
  1525.        "2  id3361153          1  2016-03-11 07:11:23  2016-03-11 07:20:09   \n",
  1526.        "3  id2129090          1  2016-03-14 14:05:39  2016-03-14 14:28:05   \n",
  1527.        "4  id0256505          1  2016-03-14 15:04:38  2016-03-14 15:16:13   \n",
  1528.        "\n",
  1529.        "   passenger_count  pickup_longitude  pickup_latitude  dropoff_longitude  \\\n",
  1530.        "0                1        -73.982155        40.767937         -73.964630   \n",
  1531.        "1                1        -73.981049        40.744339         -73.973000   \n",
  1532.        "2                1        -73.994560        40.750526         -73.978500   \n",
  1533.        "3                1        -73.975090        40.758766         -73.953201   \n",
  1534.        "4                1        -73.994484        40.745087         -73.998993   \n",
  1535.        "\n",
  1536.        "   dropoff_latitude store_and_fwd_flag  trip_duration   pickup_district  \\\n",
  1537.        "0         40.765602                  N            455         Manhattan   \n",
  1538.        "1         40.789989                  N           1225  Long Island City   \n",
  1539.        "2         40.756191                  N            526         Weehawken   \n",
  1540.        "3         40.765068                  N           1346         Manhattan   \n",
  1541.        "4         40.722710                  N            695     New York City   \n",
  1542.        "\n",
  1543.        "   dropoff_district  \n",
  1544.        "0         Manhattan  \n",
  1545.        "1         Manhattan  \n",
  1546.        "2         Manhattan  \n",
  1547.        "3  Long Island City  \n",
  1548.        "4     New York City  "
  1549.       ]
  1550.      },
  1551.      "execution_count": 603,
  1552.      "metadata": {},
  1553.      "output_type": "execute_result"
  1554.     }
  1555.    ],
  1556.    "source": [
  1557.     "data.head()"
  1558.    ]
  1559.   },
  1560.   {
  1561.    "cell_type": "code",
  1562.    "execution_count": 621,
  1563.    "metadata": {
  1564.     "scrolled": true
  1565.    },
  1566.    "outputs": [
  1567.     {
  1568.      "data": {
  1569.       "text/plain": [
  1570.        "Manhattan           45329\n",
  1571.        "New York City       34625\n",
  1572.        "Long Island City    17787\n",
  1573.        "Weehawken           11334\n",
  1574.        "The Bronx            2777\n",
  1575.        "Name: pickup_district, dtype: int64"
  1576.       ]
  1577.      },
  1578.      "execution_count": 621,
  1579.      "metadata": {},
  1580.      "output_type": "execute_result"
  1581.     }
  1582.    ],
  1583.    "source": [
  1584.     "data.pickup_district.value_counts().head()"
  1585.    ]
  1586.   },
  1587.   {
  1588.    "cell_type": "code",
  1589.    "execution_count": 622,
  1590.    "metadata": {},
  1591.    "outputs": [
  1592.     {
  1593.      "data": {
  1594.       "text/plain": [
  1595.        "Manhattan           44478\n",
  1596.        "New York City       31082\n",
  1597.        "Long Island City    19919\n",
  1598.        "Weehawken           10621\n",
  1599.        "Brooklyn             2059\n",
  1600.        "Name: dropoff_district, dtype: int64"
  1601.       ]
  1602.      },
  1603.      "execution_count": 622,
  1604.      "metadata": {},
  1605.      "output_type": "execute_result"
  1606.     }
  1607.    ],
  1608.    "source": [
  1609.     "data.dropoff_district.value_counts().head()"
  1610.    ]
  1611.   },
  1612.   {
  1613.    "cell_type": "code",
  1614.    "execution_count": 623,
  1615.    "metadata": {},
  1616.    "outputs": [
  1617.     {
  1618.      "data": {
  1619.       "text/plain": [
  1620.        "Manhattan           89807\n",
  1621.        "New York City       65707\n",
  1622.        "Long Island City    37706\n",
  1623.        "Weehawken           21955\n",
  1624.        "The Bronx            4473\n",
  1625.        "dtype: int64"
  1626.       ]
  1627.      },
  1628.      "execution_count": 623,
  1629.      "metadata": {},
  1630.      "output_type": "execute_result"
  1631.     }
  1632.    ],
  1633.    "source": [
  1634.     "all_district = data.dropoff_district.append(df.pickup_district)\n",
  1635.     "all_district.value_counts().head()"
  1636.    ]
  1637.   },
  1638.   {
  1639.    "cell_type": "code",
  1640.    "execution_count": 624,
  1641.    "metadata": {},
  1642.    "outputs": [],
  1643.    "source": [
  1644.     "from geopy.distance import geodesic\n",
  1645.     "def distances(row):\n",
  1646.     "    return geodesic((row['pickup_longitude'],row['pickup_latitude']),(row['dropoff_longitude'],row['dropoff_latitude'])).km"
  1647.    ]
  1648.   },
  1649.   {
  1650.    "cell_type": "code",
  1651.    "execution_count": 625,
  1652.    "metadata": {},
  1653.    "outputs": [],
  1654.    "source": [
  1655.     "data['distance'] = data.apply(lambda row: distances(row),axis=1)"
  1656.    ]
  1657.   },
  1658.   {
  1659.    "cell_type": "code",
  1660.    "execution_count": 626,
  1661.    "metadata": {},
  1662.    "outputs": [
  1663.     {
  1664.      "data": {
  1665.       "text/html": [
  1666.        "<div>\n",
  1667.        "<style scoped>\n",
  1668.        "    .dataframe tbody tr th:only-of-type {\n",
  1669.        "        vertical-align: middle;\n",
  1670.        "    }\n",
  1671.        "\n",
  1672.        "    .dataframe tbody tr th {\n",
  1673.        "        vertical-align: top;\n",
  1674.        "    }\n",
  1675.        "\n",
  1676.        "    .dataframe thead th {\n",
  1677.        "        text-align: right;\n",
  1678.        "    }\n",
  1679.        "</style>\n",
  1680.        "<table border=\"1\" class=\"dataframe\">\n",
  1681.        "  <thead>\n",
  1682.        "    <tr style=\"text-align: right;\">\n",
  1683.        "      <th></th>\n",
  1684.        "      <th>id</th>\n",
  1685.        "      <th>vendor_id</th>\n",
  1686.        "      <th>pickup_datetime</th>\n",
  1687.        "      <th>dropoff_datetime</th>\n",
  1688.        "      <th>passenger_count</th>\n",
  1689.        "      <th>pickup_longitude</th>\n",
  1690.        "      <th>pickup_latitude</th>\n",
  1691.        "      <th>dropoff_longitude</th>\n",
  1692.        "      <th>dropoff_latitude</th>\n",
  1693.        "      <th>store_and_fwd_flag</th>\n",
  1694.        "      <th>trip_duration</th>\n",
  1695.        "      <th>pickup_district</th>\n",
  1696.        "      <th>dropoff_district</th>\n",
  1697.        "      <th>distance</th>\n",
  1698.        "      <th>time_of_day</th>\n",
  1699.        "      <th>travel_duration</th>\n",
  1700.        "    </tr>\n",
  1701.        "  </thead>\n",
  1702.        "  <tbody>\n",
  1703.        "    <tr>\n",
  1704.        "      <th>0</th>\n",
  1705.        "      <td>id2875421</td>\n",
  1706.        "      <td>2</td>\n",
  1707.        "      <td>2016-03-14 17:24:55</td>\n",
  1708.        "      <td>2016-03-14 17:32:30</td>\n",
  1709.        "      <td>1</td>\n",
  1710.        "      <td>-73.982155</td>\n",
  1711.        "      <td>40.767937</td>\n",
  1712.        "      <td>-73.964630</td>\n",
  1713.        "      <td>40.765602</td>\n",
  1714.        "      <td>N</td>\n",
  1715.        "      <td>455</td>\n",
  1716.        "      <td>Manhattan</td>\n",
  1717.        "      <td>Manhattan</td>\n",
  1718.        "      <td>1.957222</td>\n",
  1719.        "      <td>rush_hour_evening</td>\n",
  1720.        "      <td>455.0</td>\n",
  1721.        "    </tr>\n",
  1722.        "    <tr>\n",
  1723.        "      <th>1</th>\n",
  1724.        "      <td>id0012891</td>\n",
  1725.        "      <td>2</td>\n",
  1726.        "      <td>2016-03-10 21:45:01</td>\n",
  1727.        "      <td>2016-03-10 22:05:26</td>\n",
  1728.        "      <td>1</td>\n",
  1729.        "      <td>-73.981049</td>\n",
  1730.        "      <td>40.744339</td>\n",
  1731.        "      <td>-73.973000</td>\n",
  1732.        "      <td>40.789989</td>\n",
  1733.        "      <td>N</td>\n",
  1734.        "      <td>1225</td>\n",
  1735.        "      <td>Long Island City</td>\n",
  1736.        "      <td>Manhattan</td>\n",
  1737.        "      <td>1.669367</td>\n",
  1738.        "      <td>evening</td>\n",
  1739.        "      <td>1225.0</td>\n",
  1740.        "    </tr>\n",
  1741.        "    <tr>\n",
  1742.        "      <th>2</th>\n",
  1743.        "      <td>id3361153</td>\n",
  1744.        "      <td>1</td>\n",
  1745.        "      <td>2016-03-11 07:11:23</td>\n",
  1746.        "      <td>2016-03-11 07:20:09</td>\n",
  1747.        "      <td>1</td>\n",
  1748.        "      <td>-73.994560</td>\n",
  1749.        "      <td>40.750526</td>\n",
  1750.        "      <td>-73.978500</td>\n",
  1751.        "      <td>40.756191</td>\n",
  1752.        "      <td>N</td>\n",
  1753.        "      <td>526</td>\n",
  1754.        "      <td>Weehawken</td>\n",
  1755.        "      <td>Manhattan</td>\n",
  1756.        "      <td>1.800887</td>\n",
  1757.        "      <td>rush_hour_morning</td>\n",
  1758.        "      <td>526.0</td>\n",
  1759.        "    </tr>\n",
  1760.        "    <tr>\n",
  1761.        "      <th>3</th>\n",
  1762.        "      <td>id2129090</td>\n",
  1763.        "      <td>1</td>\n",
  1764.        "      <td>2016-03-14 14:05:39</td>\n",
  1765.        "      <td>2016-03-14 14:28:05</td>\n",
  1766.        "      <td>1</td>\n",
  1767.        "      <td>-73.975090</td>\n",
  1768.        "      <td>40.758766</td>\n",
  1769.        "      <td>-73.953201</td>\n",
  1770.        "      <td>40.765068</td>\n",
  1771.        "      <td>N</td>\n",
  1772.        "      <td>1346</td>\n",
  1773.        "      <td>Manhattan</td>\n",
  1774.        "      <td>Long Island City</td>\n",
  1775.        "      <td>2.450677</td>\n",
  1776.        "      <td>afternoon</td>\n",
  1777.        "      <td>1346.0</td>\n",
  1778.        "    </tr>\n",
  1779.        "    <tr>\n",
  1780.        "      <th>4</th>\n",
  1781.        "      <td>id0256505</td>\n",
  1782.        "      <td>1</td>\n",
  1783.        "      <td>2016-03-14 15:04:38</td>\n",
  1784.        "      <td>2016-03-14 15:16:13</td>\n",
  1785.        "      <td>1</td>\n",
  1786.        "      <td>-73.994484</td>\n",
  1787.        "      <td>40.745087</td>\n",
  1788.        "      <td>-73.998993</td>\n",
  1789.        "      <td>40.722710</td>\n",
  1790.        "      <td>N</td>\n",
  1791.        "      <td>695</td>\n",
  1792.        "      <td>New York City</td>\n",
  1793.        "      <td>New York City</td>\n",
  1794.        "      <td>0.853116</td>\n",
  1795.        "      <td>afternoon</td>\n",
  1796.        "      <td>695.0</td>\n",
  1797.        "    </tr>\n",
  1798.        "  </tbody>\n",
  1799.        "</table>\n",
  1800.        "</div>"
  1801.       ],
  1802.       "text/plain": [
  1803.        "          id  vendor_id      pickup_datetime     dropoff_datetime  \\\n",
  1804.        "0  id2875421          2  2016-03-14 17:24:55  2016-03-14 17:32:30   \n",
  1805.        "1  id0012891          2  2016-03-10 21:45:01  2016-03-10 22:05:26   \n",
  1806.        "2  id3361153          1  2016-03-11 07:11:23  2016-03-11 07:20:09   \n",
  1807.        "3  id2129090          1  2016-03-14 14:05:39  2016-03-14 14:28:05   \n",
  1808.        "4  id0256505          1  2016-03-14 15:04:38  2016-03-14 15:16:13   \n",
  1809.        "\n",
  1810.        "   passenger_count  pickup_longitude  pickup_latitude  dropoff_longitude  \\\n",
  1811.        "0                1        -73.982155        40.767937         -73.964630   \n",
  1812.        "1                1        -73.981049        40.744339         -73.973000   \n",
  1813.        "2                1        -73.994560        40.750526         -73.978500   \n",
  1814.        "3                1        -73.975090        40.758766         -73.953201   \n",
  1815.        "4                1        -73.994484        40.745087         -73.998993   \n",
  1816.        "\n",
  1817.        "   dropoff_latitude store_and_fwd_flag  trip_duration   pickup_district  \\\n",
  1818.        "0         40.765602                  N            455         Manhattan   \n",
  1819.        "1         40.789989                  N           1225  Long Island City   \n",
  1820.        "2         40.756191                  N            526         Weehawken   \n",
  1821.        "3         40.765068                  N           1346         Manhattan   \n",
  1822.        "4         40.722710                  N            695     New York City   \n",
  1823.        "\n",
  1824.        "   dropoff_district  distance        time_of_day  travel_duration  \n",
  1825.        "0         Manhattan  1.957222  rush_hour_evening            455.0  \n",
  1826.        "1         Manhattan  1.669367            evening           1225.0  \n",
  1827.        "2         Manhattan  1.800887  rush_hour_morning            526.0  \n",
  1828.        "3  Long Island City  2.450677          afternoon           1346.0  \n",
  1829.        "4     New York City  0.853116          afternoon            695.0  "
  1830.       ]
  1831.      },
  1832.      "execution_count": 626,
  1833.      "metadata": {},
  1834.      "output_type": "execute_result"
  1835.     }
  1836.    ],
  1837.    "source": [
  1838.     "data.head() "
  1839.    ]
  1840.   },
  1841.   {
  1842.    "cell_type": "code",
  1843.    "execution_count": 627,
  1844.    "metadata": {},
  1845.    "outputs": [],
  1846.    "source": [
  1847.     "from datetime import datetime\n",
  1848.     "\n",
  1849.     "def get_datetime(row):\n",
  1850.     "    return datetime.strptime(row['pickup_datetime'], \"%Y-%m-%d %H:%M:%S\")"
  1851.    ]
  1852.   },
  1853.   {
  1854.    "cell_type": "code",
  1855.    "execution_count": 642,
  1856.    "metadata": {},
  1857.    "outputs": [],
  1858.    "source": [
  1859.     "def time_of_day(row):\n",
  1860.     "    h = get_datetime(row).hour\n",
  1861.     "    if 9 > h >= 7:\n",
  1862.     "        return \"rush_hour_morning\"\n",
  1863.     "    elif 16 > h >= 9:\n",
  1864.     "        return \"afternoon\"\n",
  1865.     "    elif 18 > h >= 16:\n",
  1866.     "        return \"rush_hour_evening\"\n",
  1867.     "    elif 23 > h >= 18:\n",
  1868.     "        return \"evening\"\n",
  1869.     "    else:\n",
  1870.     "        return \"late_night\""
  1871.    ]
  1872.   },
  1873.   {
  1874.    "cell_type": "code",
  1875.    "execution_count": 643,
  1876.    "metadata": {},
  1877.    "outputs": [],
  1878.    "source": [
  1879.     "data['time_of_day'] = data.apply(lambda row: time_of_day(row),axis=1)"
  1880.    ]
  1881.   },
  1882.   {
  1883.    "cell_type": "code",
  1884.    "execution_count": 630,
  1885.    "metadata": {},
  1886.    "outputs": [
  1887.     {
  1888.      "data": {
  1889.       "text/html": [
  1890.        "<div>\n",
  1891.        "<style scoped>\n",
  1892.        "    .dataframe tbody tr th:only-of-type {\n",
  1893.        "        vertical-align: middle;\n",
  1894.        "    }\n",
  1895.        "\n",
  1896.        "    .dataframe tbody tr th {\n",
  1897.        "        vertical-align: top;\n",
  1898.        "    }\n",
  1899.        "\n",
  1900.        "    .dataframe thead th {\n",
  1901.        "        text-align: right;\n",
  1902.        "    }\n",
  1903.        "</style>\n",
  1904.        "<table border=\"1\" class=\"dataframe\">\n",
  1905.        "  <thead>\n",
  1906.        "    <tr style=\"text-align: right;\">\n",
  1907.        "      <th></th>\n",
  1908.        "      <th>id</th>\n",
  1909.        "      <th>vendor_id</th>\n",
  1910.        "      <th>pickup_datetime</th>\n",
  1911.        "      <th>dropoff_datetime</th>\n",
  1912.        "      <th>passenger_count</th>\n",
  1913.        "      <th>pickup_longitude</th>\n",
  1914.        "      <th>pickup_latitude</th>\n",
  1915.        "      <th>dropoff_longitude</th>\n",
  1916.        "      <th>dropoff_latitude</th>\n",
  1917.        "      <th>store_and_fwd_flag</th>\n",
  1918.        "      <th>trip_duration</th>\n",
  1919.        "      <th>pickup_district</th>\n",
  1920.        "      <th>dropoff_district</th>\n",
  1921.        "      <th>distance</th>\n",
  1922.        "      <th>time_of_day</th>\n",
  1923.        "      <th>travel_duration</th>\n",
  1924.        "    </tr>\n",
  1925.        "  </thead>\n",
  1926.        "  <tbody>\n",
  1927.        "    <tr>\n",
  1928.        "      <th>0</th>\n",
  1929.        "      <td>id2875421</td>\n",
  1930.        "      <td>2</td>\n",
  1931.        "      <td>2016-03-14 17:24:55</td>\n",
  1932.        "      <td>2016-03-14 17:32:30</td>\n",
  1933.        "      <td>1</td>\n",
  1934.        "      <td>-73.982155</td>\n",
  1935.        "      <td>40.767937</td>\n",
  1936.        "      <td>-73.964630</td>\n",
  1937.        "      <td>40.765602</td>\n",
  1938.        "      <td>N</td>\n",
  1939.        "      <td>455</td>\n",
  1940.        "      <td>Manhattan</td>\n",
  1941.        "      <td>Manhattan</td>\n",
  1942.        "      <td>1.957222</td>\n",
  1943.        "      <td>rush_hour_evening</td>\n",
  1944.        "      <td>455.0</td>\n",
  1945.        "    </tr>\n",
  1946.        "    <tr>\n",
  1947.        "      <th>1</th>\n",
  1948.        "      <td>id0012891</td>\n",
  1949.        "      <td>2</td>\n",
  1950.        "      <td>2016-03-10 21:45:01</td>\n",
  1951.        "      <td>2016-03-10 22:05:26</td>\n",
  1952.        "      <td>1</td>\n",
  1953.        "      <td>-73.981049</td>\n",
  1954.        "      <td>40.744339</td>\n",
  1955.        "      <td>-73.973000</td>\n",
  1956.        "      <td>40.789989</td>\n",
  1957.        "      <td>N</td>\n",
  1958.        "      <td>1225</td>\n",
  1959.        "      <td>Long Island City</td>\n",
  1960.        "      <td>Manhattan</td>\n",
  1961.        "      <td>1.669367</td>\n",
  1962.        "      <td>evening</td>\n",
  1963.        "      <td>1225.0</td>\n",
  1964.        "    </tr>\n",
  1965.        "    <tr>\n",
  1966.        "      <th>2</th>\n",
  1967.        "      <td>id3361153</td>\n",
  1968.        "      <td>1</td>\n",
  1969.        "      <td>2016-03-11 07:11:23</td>\n",
  1970.        "      <td>2016-03-11 07:20:09</td>\n",
  1971.        "      <td>1</td>\n",
  1972.        "      <td>-73.994560</td>\n",
  1973.        "      <td>40.750526</td>\n",
  1974.        "      <td>-73.978500</td>\n",
  1975.        "      <td>40.756191</td>\n",
  1976.        "      <td>N</td>\n",
  1977.        "      <td>526</td>\n",
  1978.        "      <td>Weehawken</td>\n",
  1979.        "      <td>Manhattan</td>\n",
  1980.        "      <td>1.800887</td>\n",
  1981.        "      <td>rush_hour_morning</td>\n",
  1982.        "      <td>526.0</td>\n",
  1983.        "    </tr>\n",
  1984.        "    <tr>\n",
  1985.        "      <th>3</th>\n",
  1986.        "      <td>id2129090</td>\n",
  1987.        "      <td>1</td>\n",
  1988.        "      <td>2016-03-14 14:05:39</td>\n",
  1989.        "      <td>2016-03-14 14:28:05</td>\n",
  1990.        "      <td>1</td>\n",
  1991.        "      <td>-73.975090</td>\n",
  1992.        "      <td>40.758766</td>\n",
  1993.        "      <td>-73.953201</td>\n",
  1994.        "      <td>40.765068</td>\n",
  1995.        "      <td>N</td>\n",
  1996.        "      <td>1346</td>\n",
  1997.        "      <td>Manhattan</td>\n",
  1998.        "      <td>Long Island City</td>\n",
  1999.        "      <td>2.450677</td>\n",
  2000.        "      <td>afternoon</td>\n",
  2001.        "      <td>1346.0</td>\n",
  2002.        "    </tr>\n",
  2003.        "    <tr>\n",
  2004.        "      <th>4</th>\n",
  2005.        "      <td>id0256505</td>\n",
  2006.        "      <td>1</td>\n",
  2007.        "      <td>2016-03-14 15:04:38</td>\n",
  2008.        "      <td>2016-03-14 15:16:13</td>\n",
  2009.        "      <td>1</td>\n",
  2010.        "      <td>-73.994484</td>\n",
  2011.        "      <td>40.745087</td>\n",
  2012.        "      <td>-73.998993</td>\n",
  2013.        "      <td>40.722710</td>\n",
  2014.        "      <td>N</td>\n",
  2015.        "      <td>695</td>\n",
  2016.        "      <td>New York City</td>\n",
  2017.        "      <td>New York City</td>\n",
  2018.        "      <td>0.853116</td>\n",
  2019.        "      <td>afternoon</td>\n",
  2020.        "      <td>695.0</td>\n",
  2021.        "    </tr>\n",
  2022.        "  </tbody>\n",
  2023.        "</table>\n",
  2024.        "</div>"
  2025.       ],
  2026.       "text/plain": [
  2027.        "          id  vendor_id      pickup_datetime     dropoff_datetime  \\\n",
  2028.        "0  id2875421          2  2016-03-14 17:24:55  2016-03-14 17:32:30   \n",
  2029.        "1  id0012891          2  2016-03-10 21:45:01  2016-03-10 22:05:26   \n",
  2030.        "2  id3361153          1  2016-03-11 07:11:23  2016-03-11 07:20:09   \n",
  2031.        "3  id2129090          1  2016-03-14 14:05:39  2016-03-14 14:28:05   \n",
  2032.        "4  id0256505          1  2016-03-14 15:04:38  2016-03-14 15:16:13   \n",
  2033.        "\n",
  2034.        "   passenger_count  pickup_longitude  pickup_latitude  dropoff_longitude  \\\n",
  2035.        "0                1        -73.982155        40.767937         -73.964630   \n",
  2036.        "1                1        -73.981049        40.744339         -73.973000   \n",
  2037.        "2                1        -73.994560        40.750526         -73.978500   \n",
  2038.        "3                1        -73.975090        40.758766         -73.953201   \n",
  2039.        "4                1        -73.994484        40.745087         -73.998993   \n",
  2040.        "\n",
  2041.        "   dropoff_latitude store_and_fwd_flag  trip_duration   pickup_district  \\\n",
  2042.        "0         40.765602                  N            455         Manhattan   \n",
  2043.        "1         40.789989                  N           1225  Long Island City   \n",
  2044.        "2         40.756191                  N            526         Weehawken   \n",
  2045.        "3         40.765068                  N           1346         Manhattan   \n",
  2046.        "4         40.722710                  N            695     New York City   \n",
  2047.        "\n",
  2048.        "   dropoff_district  distance        time_of_day  travel_duration  \n",
  2049.        "0         Manhattan  1.957222  rush_hour_evening            455.0  \n",
  2050.        "1         Manhattan  1.669367            evening           1225.0  \n",
  2051.        "2         Manhattan  1.800887  rush_hour_morning            526.0  \n",
  2052.        "3  Long Island City  2.450677          afternoon           1346.0  \n",
  2053.        "4     New York City  0.853116          afternoon            695.0  "
  2054.       ]
  2055.      },
  2056.      "execution_count": 630,
  2057.      "metadata": {},
  2058.      "output_type": "execute_result"
  2059.     }
  2060.    ],
  2061.    "source": [
  2062.     "data.head()"
  2063.    ]
  2064.   },
  2065.   {
  2066.    "cell_type": "code",
  2067.    "execution_count": 631,
  2068.    "metadata": {},
  2069.    "outputs": [
  2070.     {
  2071.      "data": {
  2072.       "text/html": [
  2073.        "<div>\n",
  2074.        "<style scoped>\n",
  2075.        "    .dataframe tbody tr th:only-of-type {\n",
  2076.        "        vertical-align: middle;\n",
  2077.        "    }\n",
  2078.        "\n",
  2079.        "    .dataframe tbody tr th {\n",
  2080.        "        vertical-align: top;\n",
  2081.        "    }\n",
  2082.        "\n",
  2083.        "    .dataframe thead th {\n",
  2084.        "        text-align: right;\n",
  2085.        "    }\n",
  2086.        "</style>\n",
  2087.        "<table border=\"1\" class=\"dataframe\">\n",
  2088.        "  <thead>\n",
  2089.        "    <tr style=\"text-align: right;\">\n",
  2090.        "      <th></th>\n",
  2091.        "      <th>time_of_day</th>\n",
  2092.        "      <th>distance</th>\n",
  2093.        "    </tr>\n",
  2094.        "  </thead>\n",
  2095.        "  <tbody>\n",
  2096.        "    <tr>\n",
  2097.        "      <th>0</th>\n",
  2098.        "      <td>afternoon</td>\n",
  2099.        "      <td>2.678612</td>\n",
  2100.        "    </tr>\n",
  2101.        "    <tr>\n",
  2102.        "      <th>1</th>\n",
  2103.        "      <td>evening</td>\n",
  2104.        "      <td>2.735266</td>\n",
  2105.        "    </tr>\n",
  2106.        "    <tr>\n",
  2107.        "      <th>2</th>\n",
  2108.        "      <td>late_night</td>\n",
  2109.        "      <td>3.384168</td>\n",
  2110.        "    </tr>\n",
  2111.        "    <tr>\n",
  2112.        "      <th>3</th>\n",
  2113.        "      <td>rush_hour_evening</td>\n",
  2114.        "      <td>2.899539</td>\n",
  2115.        "    </tr>\n",
  2116.        "    <tr>\n",
  2117.        "      <th>4</th>\n",
  2118.        "      <td>rush_hour_morning</td>\n",
  2119.        "      <td>2.662653</td>\n",
  2120.        "    </tr>\n",
  2121.        "  </tbody>\n",
  2122.        "</table>\n",
  2123.        "</div>"
  2124.       ],
  2125.       "text/plain": [
  2126.        "         time_of_day  distance\n",
  2127.        "0          afternoon  2.678612\n",
  2128.        "1            evening  2.735266\n",
  2129.        "2         late_night  3.384168\n",
  2130.        "3  rush_hour_evening  2.899539\n",
  2131.        "4  rush_hour_morning  2.662653"
  2132.       ]
  2133.      },
  2134.      "execution_count": 631,
  2135.      "metadata": {},
  2136.      "output_type": "execute_result"
  2137.     }
  2138.    ],
  2139.    "source": [
  2140.     "data.groupby('time_of_day', as_index=False)['distance'].mean()"
  2141.    ]
  2142.   },
  2143.   {
  2144.    "cell_type": "code",
  2145.    "execution_count": 646,
  2146.    "metadata": {},
  2147.    "outputs": [],
  2148.    "source": [
  2149.     "def get_duration(row):\n",
  2150.     "    return (datetime.strptime(row['dropoff_datetime'], \"%Y-%m-%d %H:%M:%S\") - datetime.strptime(row['pickup_datetime'], \"%Y-%m-%d %H:%M:%S\")).total_seconds()"
  2151.    ]
  2152.   },
  2153.   {
  2154.    "cell_type": "code",
  2155.    "execution_count": 647,
  2156.    "metadata": {},
  2157.    "outputs": [],
  2158.    "source": [
  2159.     "data['travel_duration'] = data.apply(lambda row: get_duration(row),axis=1)"
  2160.    ]
  2161.   },
  2162.   {
  2163.    "cell_type": "code",
  2164.    "execution_count": 634,
  2165.    "metadata": {},
  2166.    "outputs": [
  2167.     {
  2168.      "data": {
  2169.       "text/html": [
  2170.        "<div>\n",
  2171.        "<style scoped>\n",
  2172.        "    .dataframe tbody tr th:only-of-type {\n",
  2173.        "        vertical-align: middle;\n",
  2174.        "    }\n",
  2175.        "\n",
  2176.        "    .dataframe tbody tr th {\n",
  2177.        "        vertical-align: top;\n",
  2178.        "    }\n",
  2179.        "\n",
  2180.        "    .dataframe thead th {\n",
  2181.        "        text-align: right;\n",
  2182.        "    }\n",
  2183.        "</style>\n",
  2184.        "<table border=\"1\" class=\"dataframe\">\n",
  2185.        "  <thead>\n",
  2186.        "    <tr style=\"text-align: right;\">\n",
  2187.        "      <th></th>\n",
  2188.        "      <th>id</th>\n",
  2189.        "      <th>vendor_id</th>\n",
  2190.        "      <th>pickup_datetime</th>\n",
  2191.        "      <th>dropoff_datetime</th>\n",
  2192.        "      <th>passenger_count</th>\n",
  2193.        "      <th>pickup_longitude</th>\n",
  2194.        "      <th>pickup_latitude</th>\n",
  2195.        "      <th>dropoff_longitude</th>\n",
  2196.        "      <th>dropoff_latitude</th>\n",
  2197.        "      <th>store_and_fwd_flag</th>\n",
  2198.        "      <th>trip_duration</th>\n",
  2199.        "      <th>pickup_district</th>\n",
  2200.        "      <th>dropoff_district</th>\n",
  2201.        "      <th>distance</th>\n",
  2202.        "      <th>time_of_day</th>\n",
  2203.        "      <th>travel_duration</th>\n",
  2204.        "    </tr>\n",
  2205.        "  </thead>\n",
  2206.        "  <tbody>\n",
  2207.        "    <tr>\n",
  2208.        "      <th>0</th>\n",
  2209.        "      <td>id2875421</td>\n",
  2210.        "      <td>2</td>\n",
  2211.        "      <td>2016-03-14 17:24:55</td>\n",
  2212.        "      <td>2016-03-14 17:32:30</td>\n",
  2213.        "      <td>1</td>\n",
  2214.        "      <td>-73.982155</td>\n",
  2215.        "      <td>40.767937</td>\n",
  2216.        "      <td>-73.964630</td>\n",
  2217.        "      <td>40.765602</td>\n",
  2218.        "      <td>N</td>\n",
  2219.        "      <td>455</td>\n",
  2220.        "      <td>Manhattan</td>\n",
  2221.        "      <td>Manhattan</td>\n",
  2222.        "      <td>1.957222</td>\n",
  2223.        "      <td>rush_hour_evening</td>\n",
  2224.        "      <td>455.0</td>\n",
  2225.        "    </tr>\n",
  2226.        "    <tr>\n",
  2227.        "      <th>1</th>\n",
  2228.        "      <td>id0012891</td>\n",
  2229.        "      <td>2</td>\n",
  2230.        "      <td>2016-03-10 21:45:01</td>\n",
  2231.        "      <td>2016-03-10 22:05:26</td>\n",
  2232.        "      <td>1</td>\n",
  2233.        "      <td>-73.981049</td>\n",
  2234.        "      <td>40.744339</td>\n",
  2235.        "      <td>-73.973000</td>\n",
  2236.        "      <td>40.789989</td>\n",
  2237.        "      <td>N</td>\n",
  2238.        "      <td>1225</td>\n",
  2239.        "      <td>Long Island City</td>\n",
  2240.        "      <td>Manhattan</td>\n",
  2241.        "      <td>1.669367</td>\n",
  2242.        "      <td>evening</td>\n",
  2243.        "      <td>1225.0</td>\n",
  2244.        "    </tr>\n",
  2245.        "    <tr>\n",
  2246.        "      <th>2</th>\n",
  2247.        "      <td>id3361153</td>\n",
  2248.        "      <td>1</td>\n",
  2249.        "      <td>2016-03-11 07:11:23</td>\n",
  2250.        "      <td>2016-03-11 07:20:09</td>\n",
  2251.        "      <td>1</td>\n",
  2252.        "      <td>-73.994560</td>\n",
  2253.        "      <td>40.750526</td>\n",
  2254.        "      <td>-73.978500</td>\n",
  2255.        "      <td>40.756191</td>\n",
  2256.        "      <td>N</td>\n",
  2257.        "      <td>526</td>\n",
  2258.        "      <td>Weehawken</td>\n",
  2259.        "      <td>Manhattan</td>\n",
  2260.        "      <td>1.800887</td>\n",
  2261.        "      <td>rush_hour_morning</td>\n",
  2262.        "      <td>526.0</td>\n",
  2263.        "    </tr>\n",
  2264.        "    <tr>\n",
  2265.        "      <th>3</th>\n",
  2266.        "      <td>id2129090</td>\n",
  2267.        "      <td>1</td>\n",
  2268.        "      <td>2016-03-14 14:05:39</td>\n",
  2269.        "      <td>2016-03-14 14:28:05</td>\n",
  2270.        "      <td>1</td>\n",
  2271.        "      <td>-73.975090</td>\n",
  2272.        "      <td>40.758766</td>\n",
  2273.        "      <td>-73.953201</td>\n",
  2274.        "      <td>40.765068</td>\n",
  2275.        "      <td>N</td>\n",
  2276.        "      <td>1346</td>\n",
  2277.        "      <td>Manhattan</td>\n",
  2278.        "      <td>Long Island City</td>\n",
  2279.        "      <td>2.450677</td>\n",
  2280.        "      <td>afternoon</td>\n",
  2281.        "      <td>1346.0</td>\n",
  2282.        "    </tr>\n",
  2283.        "    <tr>\n",
  2284.        "      <th>4</th>\n",
  2285.        "      <td>id0256505</td>\n",
  2286.        "      <td>1</td>\n",
  2287.        "      <td>2016-03-14 15:04:38</td>\n",
  2288.        "      <td>2016-03-14 15:16:13</td>\n",
  2289.        "      <td>1</td>\n",
  2290.        "      <td>-73.994484</td>\n",
  2291.        "      <td>40.745087</td>\n",
  2292.        "      <td>-73.998993</td>\n",
  2293.        "      <td>40.722710</td>\n",
  2294.        "      <td>N</td>\n",
  2295.        "      <td>695</td>\n",
  2296.        "      <td>New York City</td>\n",
  2297.        "      <td>New York City</td>\n",
  2298.        "      <td>0.853116</td>\n",
  2299.        "      <td>afternoon</td>\n",
  2300.        "      <td>695.0</td>\n",
  2301.        "    </tr>\n",
  2302.        "  </tbody>\n",
  2303.        "</table>\n",
  2304.        "</div>"
  2305.       ],
  2306.       "text/plain": [
  2307.        "          id  vendor_id      pickup_datetime     dropoff_datetime  \\\n",
  2308.        "0  id2875421          2  2016-03-14 17:24:55  2016-03-14 17:32:30   \n",
  2309.        "1  id0012891          2  2016-03-10 21:45:01  2016-03-10 22:05:26   \n",
  2310.        "2  id3361153          1  2016-03-11 07:11:23  2016-03-11 07:20:09   \n",
  2311.        "3  id2129090          1  2016-03-14 14:05:39  2016-03-14 14:28:05   \n",
  2312.        "4  id0256505          1  2016-03-14 15:04:38  2016-03-14 15:16:13   \n",
  2313.        "\n",
  2314.        "   passenger_count  pickup_longitude  pickup_latitude  dropoff_longitude  \\\n",
  2315.        "0                1        -73.982155        40.767937         -73.964630   \n",
  2316.        "1                1        -73.981049        40.744339         -73.973000   \n",
  2317.        "2                1        -73.994560        40.750526         -73.978500   \n",
  2318.        "3                1        -73.975090        40.758766         -73.953201   \n",
  2319.        "4                1        -73.994484        40.745087         -73.998993   \n",
  2320.        "\n",
  2321.        "   dropoff_latitude store_and_fwd_flag  trip_duration   pickup_district  \\\n",
  2322.        "0         40.765602                  N            455         Manhattan   \n",
  2323.        "1         40.789989                  N           1225  Long Island City   \n",
  2324.        "2         40.756191                  N            526         Weehawken   \n",
  2325.        "3         40.765068                  N           1346         Manhattan   \n",
  2326.        "4         40.722710                  N            695     New York City   \n",
  2327.        "\n",
  2328.        "   dropoff_district  distance        time_of_day  travel_duration  \n",
  2329.        "0         Manhattan  1.957222  rush_hour_evening            455.0  \n",
  2330.        "1         Manhattan  1.669367            evening           1225.0  \n",
  2331.        "2         Manhattan  1.800887  rush_hour_morning            526.0  \n",
  2332.        "3  Long Island City  2.450677          afternoon           1346.0  \n",
  2333.        "4     New York City  0.853116          afternoon            695.0  "
  2334.       ]
  2335.      },
  2336.      "execution_count": 634,
  2337.      "metadata": {},
  2338.      "output_type": "execute_result"
  2339.     }
  2340.    ],
  2341.    "source": [
  2342.     "data.head()"
  2343.    ]
  2344.   },
  2345.   {
  2346.    "cell_type": "code",
  2347.    "execution_count": 635,
  2348.    "metadata": {},
  2349.    "outputs": [
  2350.     {
  2351.      "data": {
  2352.       "text/html": [
  2353.        "<div>\n",
  2354.        "<style scoped>\n",
  2355.        "    .dataframe tbody tr th:only-of-type {\n",
  2356.        "        vertical-align: middle;\n",
  2357.        "    }\n",
  2358.        "\n",
  2359.        "    .dataframe tbody tr th {\n",
  2360.        "        vertical-align: top;\n",
  2361.        "    }\n",
  2362.        "\n",
  2363.        "    .dataframe thead th {\n",
  2364.        "        text-align: right;\n",
  2365.        "    }\n",
  2366.        "</style>\n",
  2367.        "<table border=\"1\" class=\"dataframe\">\n",
  2368.        "  <thead>\n",
  2369.        "    <tr style=\"text-align: right;\">\n",
  2370.        "      <th></th>\n",
  2371.        "      <th>time_of_day</th>\n",
  2372.        "      <th>travel_duration</th>\n",
  2373.        "    </tr>\n",
  2374.        "  </thead>\n",
  2375.        "  <tbody>\n",
  2376.        "    <tr>\n",
  2377.        "      <th>0</th>\n",
  2378.        "      <td>afternoon</td>\n",
  2379.        "      <td>963.922746</td>\n",
  2380.        "    </tr>\n",
  2381.        "    <tr>\n",
  2382.        "      <th>1</th>\n",
  2383.        "      <td>evening</td>\n",
  2384.        "      <td>893.595329</td>\n",
  2385.        "    </tr>\n",
  2386.        "    <tr>\n",
  2387.        "      <th>2</th>\n",
  2388.        "      <td>late_night</td>\n",
  2389.        "      <td>866.095457</td>\n",
  2390.        "    </tr>\n",
  2391.        "    <tr>\n",
  2392.        "      <th>3</th>\n",
  2393.        "      <td>rush_hour_evening</td>\n",
  2394.        "      <td>1024.494552</td>\n",
  2395.        "    </tr>\n",
  2396.        "    <tr>\n",
  2397.        "      <th>4</th>\n",
  2398.        "      <td>rush_hour_morning</td>\n",
  2399.        "      <td>918.488716</td>\n",
  2400.        "    </tr>\n",
  2401.        "  </tbody>\n",
  2402.        "</table>\n",
  2403.        "</div>"
  2404.       ],
  2405.       "text/plain": [
  2406.        "         time_of_day  travel_duration\n",
  2407.        "0          afternoon       963.922746\n",
  2408.        "1            evening       893.595329\n",
  2409.        "2         late_night       866.095457\n",
  2410.        "3  rush_hour_evening      1024.494552\n",
  2411.        "4  rush_hour_morning       918.488716"
  2412.       ]
  2413.      },
  2414.      "execution_count": 635,
  2415.      "metadata": {},
  2416.      "output_type": "execute_result"
  2417.     }
  2418.    ],
  2419.    "source": [
  2420.     "data.groupby('time_of_day', as_index=False)['travel_duration'].mean()"
  2421.    ]
  2422.   },
  2423.   {
  2424.    "cell_type": "code",
  2425.    "execution_count": 636,
  2426.    "metadata": {},
  2427.    "outputs": [
  2428.     {
  2429.      "name": "stdout",
  2430.      "output_type": "stream",
  2431.      "text": [
  2432.       "Pearson Correlation Coefficient:  0.004813315643048912 and a P-value of: 0.09798213705452344\n"
  2433.      ]
  2434.     }
  2435.    ],
  2436.    "source": [
  2437.     "from scipy import stats\n",
  2438.     "pearson_coef, p_value = stats.pearsonr(data['passenger_count'], data['distance'])\n",
  2439.     "print(\"Pearson Correlation Coefficient: \", pearson_coef, \"and a P-value of:\", p_value)"
  2440.    ]
  2441.   },
  2442.   {
  2443.    "cell_type": "code",
  2444.    "execution_count": 637,
  2445.    "metadata": {},
  2446.    "outputs": [
  2447.     {
  2448.      "data": {
  2449.       "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEKCAYAAAAIO8L1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAHixJREFUeJzt3X+UXGWd5/H3p3+k06QJSToRYzpOUBjZUTEyPY5M5rgIyiggMAPrcRRl0V32eFx/rLsCzjqjM6MOMHMcnbO7nomCBmVEhz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kt7AjydrCtxHjz/hbk6Im4FLgGOArokvTwi7ouIy6nM8Hs8lQkc35u8HkmrJL0oK4GoTOe9R9LvJqF3TPj194H3J9OYI+k3a1jY5RbgP0jqTl67LIn/64RtvAv4SXL/MeC3k/tnUVnFbjp7gCOrzMfmKR9NWFn9gsrCL1dROdn7RWAplXMCT1H50ofKjL1fV2WpRgF/FxG7Jf2lpDdSWS3tAeB7ETEs6d8BtyXnt/cC51M58s7yPuBLksaAf6HS5w+VZTrXAHcnJ8sHgHOq2bGIeEDSZ4B/kXSQSpfXf6Qyi+dXJH0seb/xWTy/BNwg6V7gZqproawHbpb0RES8sZq8bP7xMFcrnaTL56aIyH2lNkldkaxBLelSYGVEfDjntMzqwi0Is9k5Q9LHqfwt/YrKkb5ZU3ALwiwnyTmGTSm/OjUids11PmZTuUCYmVkqj2IyM7NULhBmZpbKBcLMzFK5QJiZWSoXCDMzS/X/Ab83IVoxSPx9AAAAAElFTkSuQmCC\n",
  2450.       "text/plain": [
  2451.        "<Figure size 432x288 with 1 Axes>"
  2452.       ]
  2453.      },
  2454.      "metadata": {
  2455.       "needs_background": "light"
  2456.      },
  2457.      "output_type": "display_data"
  2458.     }
  2459.    ],
  2460.    "source": [
  2461.     "data.plot(kind='scatter', x='passenger_count',y='distance')\n",
  2462.     "plt.show()"
  2463.    ]
  2464.   },
  2465.   {
  2466.    "cell_type": "code",
  2467.    "execution_count": 638,
  2468.    "metadata": {},
  2469.    "outputs": [
  2470.     {
  2471.      "data": {
  2472.       "text/html": [
  2473.        "<div>\n",
  2474.        "<style scoped>\n",
  2475.        "    .dataframe tbody tr th:only-of-type {\n",
  2476.        "        vertical-align: middle;\n",
  2477.        "    }\n",
  2478.        "\n",
  2479.        "    .dataframe tbody tr th {\n",
  2480.        "        vertical-align: top;\n",
  2481.        "    }\n",
  2482.        "\n",
  2483.        "    .dataframe thead th {\n",
  2484.        "        text-align: right;\n",
  2485.        "    }\n",
  2486.        "</style>\n",
  2487.        "<table border=\"1\" class=\"dataframe\">\n",
  2488.        "  <thead>\n",
  2489.        "    <tr style=\"text-align: right;\">\n",
  2490.        "      <th></th>\n",
  2491.        "      <th>id</th>\n",
  2492.        "      <th>vendor_id</th>\n",
  2493.        "      <th>pickup_datetime</th>\n",
  2494.        "      <th>dropoff_datetime</th>\n",
  2495.        "      <th>passenger_count</th>\n",
  2496.        "      <th>pickup_longitude</th>\n",
  2497.        "      <th>pickup_latitude</th>\n",
  2498.        "      <th>dropoff_longitude</th>\n",
  2499.        "      <th>dropoff_latitude</th>\n",
  2500.        "      <th>store_and_fwd_flag</th>\n",
  2501.        "      <th>trip_duration</th>\n",
  2502.        "      <th>pickup_district</th>\n",
  2503.        "      <th>dropoff_district</th>\n",
  2504.        "      <th>distance</th>\n",
  2505.        "      <th>time_of_day</th>\n",
  2506.        "      <th>travel_duration</th>\n",
  2507.        "      <th>day_of_week</th>\n",
  2508.        "    </tr>\n",
  2509.        "  </thead>\n",
  2510.        "  <tbody>\n",
  2511.        "    <tr>\n",
  2512.        "      <th>0</th>\n",
  2513.        "      <td>id2875421</td>\n",
  2514.        "      <td>2</td>\n",
  2515.        "      <td>2016-03-14 17:24:55</td>\n",
  2516.        "      <td>2016-03-14 17:32:30</td>\n",
  2517.        "      <td>1</td>\n",
  2518.        "      <td>-73.982155</td>\n",
  2519.        "      <td>40.767937</td>\n",
  2520.        "      <td>-73.964630</td>\n",
  2521.        "      <td>40.765602</td>\n",
  2522.        "      <td>N</td>\n",
  2523.        "      <td>455</td>\n",
  2524.        "      <td>Manhattan</td>\n",
  2525.        "      <td>Manhattan</td>\n",
  2526.        "      <td>1.957222</td>\n",
  2527.        "      <td>rush_hour_evening</td>\n",
  2528.        "      <td>455.0</td>\n",
  2529.        "      <td>0</td>\n",
  2530.        "    </tr>\n",
  2531.        "    <tr>\n",
  2532.        "      <th>1</th>\n",
  2533.        "      <td>id0012891</td>\n",
  2534.        "      <td>2</td>\n",
  2535.        "      <td>2016-03-10 21:45:01</td>\n",
  2536.        "      <td>2016-03-10 22:05:26</td>\n",
  2537.        "      <td>1</td>\n",
  2538.        "      <td>-73.981049</td>\n",
  2539.        "      <td>40.744339</td>\n",
  2540.        "      <td>-73.973000</td>\n",
  2541.        "      <td>40.789989</td>\n",
  2542.        "      <td>N</td>\n",
  2543.        "      <td>1225</td>\n",
  2544.        "      <td>Long Island City</td>\n",
  2545.        "      <td>Manhattan</td>\n",
  2546.        "      <td>1.669367</td>\n",
  2547.        "      <td>evening</td>\n",
  2548.        "      <td>1225.0</td>\n",
  2549.        "      <td>0</td>\n",
  2550.        "    </tr>\n",
  2551.        "    <tr>\n",
  2552.        "      <th>2</th>\n",
  2553.        "      <td>id3361153</td>\n",
  2554.        "      <td>1</td>\n",
  2555.        "      <td>2016-03-11 07:11:23</td>\n",
  2556.        "      <td>2016-03-11 07:20:09</td>\n",
  2557.        "      <td>1</td>\n",
  2558.        "      <td>-73.994560</td>\n",
  2559.        "      <td>40.750526</td>\n",
  2560.        "      <td>-73.978500</td>\n",
  2561.        "      <td>40.756191</td>\n",
  2562.        "      <td>N</td>\n",
  2563.        "      <td>526</td>\n",
  2564.        "      <td>Weehawken</td>\n",
  2565.        "      <td>Manhattan</td>\n",
  2566.        "      <td>1.800887</td>\n",
  2567.        "      <td>rush_hour_morning</td>\n",
  2568.        "      <td>526.0</td>\n",
  2569.        "      <td>0</td>\n",
  2570.        "    </tr>\n",
  2571.        "    <tr>\n",
  2572.        "      <th>3</th>\n",
  2573.        "      <td>id2129090</td>\n",
  2574.        "      <td>1</td>\n",
  2575.        "      <td>2016-03-14 14:05:39</td>\n",
  2576.        "      <td>2016-03-14 14:28:05</td>\n",
  2577.        "      <td>1</td>\n",
  2578.        "      <td>-73.975090</td>\n",
  2579.        "      <td>40.758766</td>\n",
  2580.        "      <td>-73.953201</td>\n",
  2581.        "      <td>40.765068</td>\n",
  2582.        "      <td>N</td>\n",
  2583.        "      <td>1346</td>\n",
  2584.        "      <td>Manhattan</td>\n",
  2585.        "      <td>Long Island City</td>\n",
  2586.        "      <td>2.450677</td>\n",
  2587.        "      <td>afternoon</td>\n",
  2588.        "      <td>1346.0</td>\n",
  2589.        "      <td>0</td>\n",
  2590.        "    </tr>\n",
  2591.        "    <tr>\n",
  2592.        "      <th>4</th>\n",
  2593.        "      <td>id0256505</td>\n",
  2594.        "      <td>1</td>\n",
  2595.        "      <td>2016-03-14 15:04:38</td>\n",
  2596.        "      <td>2016-03-14 15:16:13</td>\n",
  2597.        "      <td>1</td>\n",
  2598.        "      <td>-73.994484</td>\n",
  2599.        "      <td>40.745087</td>\n",
  2600.        "      <td>-73.998993</td>\n",
  2601.        "      <td>40.722710</td>\n",
  2602.        "      <td>N</td>\n",
  2603.        "      <td>695</td>\n",
  2604.        "      <td>New York City</td>\n",
  2605.        "      <td>New York City</td>\n",
  2606.        "      <td>0.853116</td>\n",
  2607.        "      <td>afternoon</td>\n",
  2608.        "      <td>695.0</td>\n",
  2609.        "      <td>0</td>\n",
  2610.        "    </tr>\n",
  2611.        "  </tbody>\n",
  2612.        "</table>\n",
  2613.        "</div>"
  2614.       ],
  2615.       "text/plain": [
  2616.        "          id  vendor_id      pickup_datetime     dropoff_datetime  \\\n",
  2617.        "0  id2875421          2  2016-03-14 17:24:55  2016-03-14 17:32:30   \n",
  2618.        "1  id0012891          2  2016-03-10 21:45:01  2016-03-10 22:05:26   \n",
  2619.        "2  id3361153          1  2016-03-11 07:11:23  2016-03-11 07:20:09   \n",
  2620.        "3  id2129090          1  2016-03-14 14:05:39  2016-03-14 14:28:05   \n",
  2621.        "4  id0256505          1  2016-03-14 15:04:38  2016-03-14 15:16:13   \n",
  2622.        "\n",
  2623.        "   passenger_count  pickup_longitude  pickup_latitude  dropoff_longitude  \\\n",
  2624.        "0                1        -73.982155        40.767937         -73.964630   \n",
  2625.        "1                1        -73.981049        40.744339         -73.973000   \n",
  2626.        "2                1        -73.994560        40.750526         -73.978500   \n",
  2627.        "3                1        -73.975090        40.758766         -73.953201   \n",
  2628.        "4                1        -73.994484        40.745087         -73.998993   \n",
  2629.        "\n",
  2630.        "   dropoff_latitude store_and_fwd_flag  trip_duration   pickup_district  \\\n",
  2631.        "0         40.765602                  N            455         Manhattan   \n",
  2632.        "1         40.789989                  N           1225  Long Island City   \n",
  2633.        "2         40.756191                  N            526         Weehawken   \n",
  2634.        "3         40.765068                  N           1346         Manhattan   \n",
  2635.        "4         40.722710                  N            695     New York City   \n",
  2636.        "\n",
  2637.        "   dropoff_district  distance        time_of_day  travel_duration  day_of_week  \n",
  2638.        "0         Manhattan  1.957222  rush_hour_evening            455.0            0  \n",
  2639.        "1         Manhattan  1.669367            evening           1225.0            0  \n",
  2640.        "2         Manhattan  1.800887  rush_hour_morning            526.0            0  \n",
  2641.        "3  Long Island City  2.450677          afternoon           1346.0            0  \n",
  2642.        "4     New York City  0.853116          afternoon            695.0            0  "
  2643.       ]
  2644.      },
  2645.      "execution_count": 638,
  2646.      "metadata": {},
  2647.      "output_type": "execute_result"
  2648.     }
  2649.    ],
  2650.    "source": [
  2651.     "def weekday(row):\n",
  2652.     "    weeknum = get_datetime(row).weekday()\n",
  2653.     "    if weeknum < 5:\n",
  2654.     "        return 0\n",
  2655.     "    else:\n",
  2656.     "        return 1\n",
  2657.     "data['day_of_week'] = data.apply(lambda row: weekday(row),axis=1)\n",
  2658.     "data.head()"
  2659.    ]
  2660.   },
  2661.   {
  2662.    "cell_type": "code",
  2663.    "execution_count": 639,
  2664.    "metadata": {},
  2665.    "outputs": [
  2666.     {
  2667.      "name": "stdout",
  2668.      "output_type": "stream",
  2669.      "text": [
  2670.       "Pearson Correlation Coefficient:  0.004731705992091192 and a P-value of: 0.10380934335828981\n"
  2671.      ]
  2672.     }
  2673.    ],
  2674.    "source": [
  2675.     "pearson_coef, p_value = stats.pearsonr(data['day_of_week'], data['distance'])\n",
  2676.     "print(\"Pearson Correlation Coefficient: \", pearson_coef, \"and a P-value of:\", p_value)"
  2677.    ]
  2678.   },
  2679.   {
  2680.    "cell_type": "code",
  2681.    "execution_count": 640,
  2682.    "metadata": {},
  2683.    "outputs": [
  2684.     {
  2685.      "data": {
  2686.       "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAELCAYAAADDZxFQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGNtJREFUeJzt3X10HfV95/H3R5YsC2xjYas+1AJMYxKWUscBJYW6ySaBzRLS2mzN4ZCTB4flhFOaNk1Jguk2OWTThw3ONtm0J6eJGxJMDyU8OK29bVKWYyDQFNwIMAoGEhwCQebBiiMbGyRZ8v3uH3dUXylz0ZV05869vp/XObZmfnfuzHck+34085uZnyICMzOzyVryLsDMzOqTA8LMzFI5IMzMLJUDwszMUjkgzMwslQPCzMxSOSDMzCyVA8LMzFI5IMzMLFVr3gXMxpIlS2L58uV5l2Fm1lAeeuihn0VE11TLNXRALF++nN7e3rzLMDNrKJKerWQ5n2IyM7NUDggzM0vlgDAzs1QOCDMzS+WAMDOzVA4IM7MGse/QCI8+t599h0Zqsr2GvszVzKxZbN25hw1b+mhraWG0UGDjupWsWbUs0236CMLMrM7tOzTChi19DI8WODgyxvBogWu29GV+JOGAMDOrc/2DQ7S1TPy4bmtpoX9wKNPtOiDMzOpcd2cHo4XChLbRQoHuzo5Mt+uAMDOrc4vnt7Nx3UrmtbWwoL2VeW0tbFy3ksXz2zPdrjupzcwawJpVy1i9Ygn9g0N0d3ZkHg7ggDAzaxiL57fXJBjG+RSTmZmlyiwgJH1d0l5Jj5W0nSjpLklPJV87k3ZJ+itJuyX1STo7q7rMzKwyWR5B3AhcOKntWmB7RJwObE/mAd4NnJ78uRL4mwzrMjOzCmQWEBFxH/DzSc1rgc3J9Gbg4pL2m6LoQWCRpJOyqs3MzKZW6z6IpRHxQjL9IrA0mV4GPFeyXH/S9gskXSmpV1LvwMBAdpWamTW53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/r9ts+bHfZuVkHQJsDYiPpB3LWZ586GoWULSXwPvpnjFk1nT8xGE2WuQ9GVg9aTmL0VE2T6K5H2Lge0pL53fqCO7WfNxQJiZWSp3ZJmZWSoHhJmZpXJAmJlZKgeEmZmlckCYmVmq/w/A3ERRmTvz1wAAAABJRU5ErkJggg==\n",
  2687.       "text/plain": [
  2688.        "<Figure size 432x288 with 1 Axes>"
  2689.       ]
  2690.      },
  2691.      "metadata": {
  2692.       "needs_background": "light"
  2693.      },
  2694.      "output_type": "display_data"
  2695.     }
  2696.    ],
  2697.    "source": [
  2698.     "data.plot(kind=\"scatter\", x='day_of_week',y='distance')\n",
  2699.     "plt.show()"
  2700.    ]
  2701.   },
  2702.   {
  2703.    "cell_type": "code",
  2704.    "execution_count": null,
  2705.    "metadata": {},
  2706.    "outputs": [],
  2707.    "source": []
  2708.   }
  2709.  ],
  2710.  "metadata": {
  2711.   "kernelspec": {
  2712.    "display_name": "Python 3",
  2713.    "language": "python",
  2714.    "name": "python3"
  2715.   },
  2716.   "language_info": {
  2717.    "codemirror_mode": {
  2718.     "name": "ipython",
  2719.     "version": 3
  2720.    },
  2721.    "file_extension": ".py",
  2722.    "mimetype": "text/x-python",
  2723.    "name": "python",
  2724.    "nbconvert_exporter": "python",
  2725.    "pygments_lexer": "ipython3",
  2726.    "version": "3.7.2"
  2727.   }
  2728.  },
  2729.  "nbformat": 4,
  2730.  "nbformat_minor": 2
  2731. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top