|
60 | 60 | "output_type": "stream",
|
61 | 61 | "text": [
|
62 | 62 | "Telematics Data Dictionary 2023_02_14.xlsx\n",
|
| 63 | + "Telematics Data Dictionary 2023_02_14.xlsx - SNAP_SHOT_ITEM (1).csv\n", |
63 | 64 | "Vehicle_Fault.csv\n",
|
64 | 65 | "Vehicle_Fault_Alarm.csv\n",
|
65 | 66 | "Vehicle_Fault_Alarm_Item.csv\n",
|
|
77 | 78 | },
|
78 | 79 | {
|
79 | 80 | "cell_type": "code",
|
80 |
| - "execution_count": 5, |
| 81 | + "execution_count": null, |
81 | 82 | "id": "887c82d7-61cb-483a-b046-9547a919ae21",
|
82 | 83 | "metadata": {},
|
83 |
| - "outputs": [ |
84 |
| - { |
85 |
| - "ename": "KeyboardInterrupt", |
86 |
| - "evalue": "", |
87 |
| - "output_type": "error", |
88 |
| - "traceback": [ |
89 |
| - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
90 |
| - "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", |
91 |
| - "File \u001b[0;32m<timed exec>:3\u001b[0m\n", |
92 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/util/_decorators.py:211\u001b[0m, in \u001b[0;36mdeprecate_kwarg.<locals>._deprecate_kwarg.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 209\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 210\u001b[0m kwargs[new_arg_name] \u001b[39m=\u001b[39m new_arg_value\n\u001b[0;32m--> 211\u001b[0m \u001b[39mreturn\u001b[39;00m func(\u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n", |
93 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/util/_decorators.py:331\u001b[0m, in \u001b[0;36mdeprecate_nonkeyword_arguments.<locals>.decorate.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 325\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mlen\u001b[39m(args) \u001b[39m>\u001b[39m num_allow_args:\n\u001b[1;32m 326\u001b[0m warnings\u001b[39m.\u001b[39mwarn(\n\u001b[1;32m 327\u001b[0m msg\u001b[39m.\u001b[39mformat(arguments\u001b[39m=\u001b[39m_format_argument_list(allow_args)),\n\u001b[1;32m 328\u001b[0m \u001b[39mFutureWarning\u001b[39;00m,\n\u001b[1;32m 329\u001b[0m stacklevel\u001b[39m=\u001b[39mfind_stack_level(),\n\u001b[1;32m 330\u001b[0m )\n\u001b[0;32m--> 331\u001b[0m \u001b[39mreturn\u001b[39;00m func(\u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n", |
94 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/io/parsers/readers.py:950\u001b[0m, in \u001b[0;36mread_csv\u001b[0;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options)\u001b[0m\n\u001b[1;32m 935\u001b[0m kwds_defaults \u001b[39m=\u001b[39m _refine_defaults_read(\n\u001b[1;32m 936\u001b[0m dialect,\n\u001b[1;32m 937\u001b[0m delimiter,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 946\u001b[0m defaults\u001b[39m=\u001b[39m{\u001b[39m\"\u001b[39m\u001b[39mdelimiter\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39m\"\u001b[39m\u001b[39m,\u001b[39m\u001b[39m\"\u001b[39m},\n\u001b[1;32m 947\u001b[0m )\n\u001b[1;32m 948\u001b[0m kwds\u001b[39m.\u001b[39mupdate(kwds_defaults)\n\u001b[0;32m--> 950\u001b[0m \u001b[39mreturn\u001b[39;00m _read(filepath_or_buffer, kwds)\n", |
95 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/io/parsers/readers.py:611\u001b[0m, in \u001b[0;36m_read\u001b[0;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[1;32m 608\u001b[0m \u001b[39mreturn\u001b[39;00m parser\n\u001b[1;32m 610\u001b[0m \u001b[39mwith\u001b[39;00m parser:\n\u001b[0;32m--> 611\u001b[0m \u001b[39mreturn\u001b[39;00m parser\u001b[39m.\u001b[39;49mread(nrows)\n", |
96 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/io/parsers/readers.py:1778\u001b[0m, in \u001b[0;36mTextFileReader.read\u001b[0;34m(self, nrows)\u001b[0m\n\u001b[1;32m 1771\u001b[0m nrows \u001b[39m=\u001b[39m validate_integer(\u001b[39m\"\u001b[39m\u001b[39mnrows\u001b[39m\u001b[39m\"\u001b[39m, nrows)\n\u001b[1;32m 1772\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 1773\u001b[0m \u001b[39m# error: \"ParserBase\" has no attribute \"read\"\u001b[39;00m\n\u001b[1;32m 1774\u001b[0m (\n\u001b[1;32m 1775\u001b[0m index,\n\u001b[1;32m 1776\u001b[0m columns,\n\u001b[1;32m 1777\u001b[0m col_dict,\n\u001b[0;32m-> 1778\u001b[0m ) \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_engine\u001b[39m.\u001b[39;49mread( \u001b[39m# type: ignore[attr-defined]\u001b[39;49;00m\n\u001b[1;32m 1779\u001b[0m nrows\n\u001b[1;32m 1780\u001b[0m )\n\u001b[1;32m 1781\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mException\u001b[39;00m:\n\u001b[1;32m 1782\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mclose()\n", |
97 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/io/parsers/c_parser_wrapper.py:230\u001b[0m, in \u001b[0;36mCParserWrapper.read\u001b[0;34m(self, nrows)\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 229\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mlow_memory:\n\u001b[0;32m--> 230\u001b[0m chunks \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_reader\u001b[39m.\u001b[39;49mread_low_memory(nrows)\n\u001b[1;32m 231\u001b[0m \u001b[39m# destructive to chunks\u001b[39;00m\n\u001b[1;32m 232\u001b[0m data \u001b[39m=\u001b[39m _concatenate_chunks(chunks)\n", |
98 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/_libs/parsers.pyx:808\u001b[0m, in \u001b[0;36mpandas._libs.parsers.TextReader.read_low_memory\u001b[0;34m()\u001b[0m\n", |
99 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/_libs/parsers.pyx:866\u001b[0m, in \u001b[0;36mpandas._libs.parsers.TextReader._read_rows\u001b[0;34m()\u001b[0m\n", |
100 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/_libs/parsers.pyx:852\u001b[0m, in \u001b[0;36mpandas._libs.parsers.TextReader._tokenize_rows\u001b[0;34m()\u001b[0m\n", |
101 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pandas/_libs/parsers.pyx:1965\u001b[0m, in \u001b[0;36mpandas._libs.parsers.raise_parser_error\u001b[0;34m()\u001b[0m\n", |
102 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/response.py:99\u001b[0m, in \u001b[0;36mStreamingBody.read\u001b[0;34m(self, amt)\u001b[0m\n\u001b[1;32m 94\u001b[0m \u001b[39m\"\"\"Read at most amt bytes from the stream.\u001b[39;00m\n\u001b[1;32m 95\u001b[0m \n\u001b[1;32m 96\u001b[0m \u001b[39mIf the amt argument is omitted, read all data.\u001b[39;00m\n\u001b[1;32m 97\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 98\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m---> 99\u001b[0m chunk \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_raw_stream\u001b[39m.\u001b[39;49mread(amt)\n\u001b[1;32m 100\u001b[0m \u001b[39mexcept\u001b[39;00m URLLib3ReadTimeoutError \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m 101\u001b[0m \u001b[39m# TODO: the url will be None as urllib3 isn't setting it yet\u001b[39;00m\n\u001b[1;32m 102\u001b[0m \u001b[39mraise\u001b[39;00m ReadTimeoutError(endpoint_url\u001b[39m=\u001b[39me\u001b[39m.\u001b[39murl, error\u001b[39m=\u001b[39me)\n", |
103 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/response.py:566\u001b[0m, in \u001b[0;36mHTTPResponse.read\u001b[0;34m(self, amt, decode_content, cache_content)\u001b[0m\n\u001b[1;32m 563\u001b[0m fp_closed \u001b[39m=\u001b[39m \u001b[39mgetattr\u001b[39m(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_fp, \u001b[39m\"\u001b[39m\u001b[39mclosed\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mFalse\u001b[39;00m)\n\u001b[1;32m 565\u001b[0m \u001b[39mwith\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_error_catcher():\n\u001b[0;32m--> 566\u001b[0m data \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_fp_read(amt) \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m fp_closed \u001b[39melse\u001b[39;00m \u001b[39mb\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 567\u001b[0m \u001b[39mif\u001b[39;00m amt \u001b[39mis\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 568\u001b[0m flush_decoder \u001b[39m=\u001b[39m \u001b[39mTrue\u001b[39;00m\n", |
104 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/response.py:532\u001b[0m, in \u001b[0;36mHTTPResponse._fp_read\u001b[0;34m(self, amt)\u001b[0m\n\u001b[1;32m 529\u001b[0m \u001b[39mreturn\u001b[39;00m buffer\u001b[39m.\u001b[39mgetvalue()\n\u001b[1;32m 530\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 531\u001b[0m \u001b[39m# StringIO doesn't like amt=None\u001b[39;00m\n\u001b[0;32m--> 532\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_fp\u001b[39m.\u001b[39;49mread(amt) \u001b[39mif\u001b[39;00m amt \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m \u001b[39melse\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_fp\u001b[39m.\u001b[39mread()\n", |
105 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:465\u001b[0m, in \u001b[0;36mHTTPResponse.read\u001b[0;34m(self, amt)\u001b[0m\n\u001b[1;32m 462\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mlength \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m \u001b[39mand\u001b[39;00m amt \u001b[39m>\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mlength:\n\u001b[1;32m 463\u001b[0m \u001b[39m# clip the read to the \"end of response\"\u001b[39;00m\n\u001b[1;32m 464\u001b[0m amt \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mlength\n\u001b[0;32m--> 465\u001b[0m s \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mfp\u001b[39m.\u001b[39mread(amt)\n\u001b[1;32m 466\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m s \u001b[39mand\u001b[39;00m amt:\n\u001b[1;32m 467\u001b[0m \u001b[39m# Ideally, we would raise IncompleteRead if the content-length\u001b[39;00m\n\u001b[1;32m 468\u001b[0m \u001b[39m# wasn't satisfied, but it might break compatibility.\u001b[39;00m\n\u001b[1;32m 469\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_close_conn()\n", |
106 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socket.py:706\u001b[0m, in \u001b[0;36mSocketIO.readinto\u001b[0;34m(self, b)\u001b[0m\n\u001b[1;32m 704\u001b[0m \u001b[39mwhile\u001b[39;00m \u001b[39mTrue\u001b[39;00m:\n\u001b[1;32m 705\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 706\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_sock\u001b[39m.\u001b[39;49mrecv_into(b)\n\u001b[1;32m 707\u001b[0m \u001b[39mexcept\u001b[39;00m timeout:\n\u001b[1;32m 708\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_timeout_occurred \u001b[39m=\u001b[39m \u001b[39mTrue\u001b[39;00m\n", |
107 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py:1278\u001b[0m, in \u001b[0;36mSSLSocket.recv_into\u001b[0;34m(self, buffer, nbytes, flags)\u001b[0m\n\u001b[1;32m 1274\u001b[0m \u001b[39mif\u001b[39;00m flags \u001b[39m!=\u001b[39m \u001b[39m0\u001b[39m:\n\u001b[1;32m 1275\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[1;32m 1276\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mnon-zero flags not allowed in calls to recv_into() on \u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m\"\u001b[39m \u001b[39m%\u001b[39m\n\u001b[1;32m 1277\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m\u001b[39m__class__\u001b[39m)\n\u001b[0;32m-> 1278\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mread(nbytes, buffer)\n\u001b[1;32m 1279\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 1280\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39msuper\u001b[39m()\u001b[39m.\u001b[39mrecv_into(buffer, nbytes, flags)\n", |
108 |
| - "File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py:1134\u001b[0m, in \u001b[0;36mSSLSocket.read\u001b[0;34m(self, len, buffer)\u001b[0m\n\u001b[1;32m 1132\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 1133\u001b[0m \u001b[39mif\u001b[39;00m buffer \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m-> 1134\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_sslobj\u001b[39m.\u001b[39;49mread(\u001b[39mlen\u001b[39;49m, buffer)\n\u001b[1;32m 1135\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 1136\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_sslobj\u001b[39m.\u001b[39mread(\u001b[39mlen\u001b[39m)\n", |
109 |
| - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " |
110 |
| - ] |
111 |
| - } |
112 |
| - ], |
| 84 | + "outputs": [], |
113 | 85 | "source": [
|
114 | 86 | "%%time\n",
|
115 | 87 | "# Load one of the files into a dataframe\n",
|
|
119 | 91 | },
|
120 | 92 | {
|
121 | 93 | "cell_type": "code",
|
122 |
| - "execution_count": 6, |
| 94 | + "execution_count": 5, |
123 | 95 | "id": "f719bce8",
|
124 | 96 | "metadata": {},
|
125 | 97 | "outputs": [
|
126 | 98 | {
|
127 | 99 | "name": "stdout",
|
128 | 100 | "output_type": "stream",
|
129 | 101 | "text": [
|
130 |
| - "CPU times: user 29.1 s, sys: 2.96 s, total: 32 s\n", |
131 |
| - "Wall time: 32.4 s\n" |
| 102 | + "CPU times: user 28.4 s, sys: 3.61 s, total: 32 s\n", |
| 103 | + "Wall time: 32.8 s\n" |
132 | 104 | ]
|
133 | 105 | }
|
134 | 106 | ],
|
|
140 | 112 | },
|
141 | 113 | {
|
142 | 114 | "cell_type": "code",
|
143 |
| - "execution_count": 7, |
| 115 | + "execution_count": 6, |
144 | 116 | "id": "8287e107-7ab8-4662-b304-0a679a5ebae3",
|
145 | 117 | "metadata": {},
|
146 | 118 | "outputs": [
|
|
161 | 133 | },
|
162 | 134 | {
|
163 | 135 | "cell_type": "code",
|
164 |
| - "execution_count": 8, |
| 136 | + "execution_count": 7, |
165 | 137 | "id": "2509d99e-8587-48ed-b8ed-d08934b3314d",
|
166 | 138 | "metadata": {},
|
167 | 139 | "outputs": [
|
|
184 | 156 | },
|
185 | 157 | {
|
186 | 158 | "cell_type": "code",
|
187 |
| - "execution_count": 10, |
| 159 | + "execution_count": 8, |
188 | 160 | "id": "404eaff7-57b6-4f51-995a-e8b70203f225",
|
189 | 161 | "metadata": {},
|
190 | 162 | "outputs": [
|
|
228 | 200 | ],
|
229 | 201 | "metadata": {
|
230 | 202 | "kernelspec": {
|
231 |
| - "display_name": "Python 3", |
| 203 | + "display_name": "Python 3 (ipykernel)", |
232 | 204 | "language": "python",
|
233 | 205 | "name": "python3"
|
234 | 206 | },
|
|
0 commit comments