Skip to content
Permalink
4de5665a84
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
848 lines (848 sloc) 27.9 KB
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "9a3d1d4d-54e0-4725-933b-8337450f2df3",
"metadata": {
"id": "9a3d1d4d-54e0-4725-933b-8337450f2df3"
},
"outputs": [],
"source": [
"import pandas as pd\n",
"import torch.nn as nn\n",
"import torch\n",
"from datetime import datetime, timedelta\n",
"import numpy as np"
]
},
{
"cell_type": "markdown",
"id": "cc2e45cc-2981-4ff4-bbdd-b640b3bcbc37",
"metadata": {
"id": "cc2e45cc-2981-4ff4-bbdd-b640b3bcbc37"
},
"source": [
"## data processing"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c421468f-c578-4583-8747-a30b5e2e8bf6",
"metadata": {
"id": "c421468f-c578-4583-8747-a30b5e2e8bf6"
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 60,
"id": "b298662f-dadb-451e-9ee7-8c6f2989d3b9",
"metadata": {
"id": "b298662f-dadb-451e-9ee7-8c6f2989d3b9"
},
"outputs": [],
"source": [
"import pandas as pd\n",
"df = pd.read_csv(\"./data/E-Scooter_Trips_-_2020.csv\")"
]
},
{
"cell_type": "code",
"execution_count": 61,
"id": "19665919-c190-4d8b-af25-b50998df6e20",
"metadata": {
"id": "19665919-c190-4d8b-af25-b50998df6e20"
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Trip ID</th>\n",
" <th>Start Time</th>\n",
" <th>End Time</th>\n",
" <th>Trip Distance</th>\n",
" <th>Trip Duration</th>\n",
" <th>Vendor</th>\n",
" <th>Start Community Area Number</th>\n",
" <th>End Community Area Number</th>\n",
" <th>Start Community Area Name</th>\n",
" <th>End Community Area Name</th>\n",
" <th>Start Centroid Latitude</th>\n",
" <th>Start Centroid Longitude</th>\n",
" <th>Start Centroid Location</th>\n",
" <th>End Centroid Latitude</th>\n",
" <th>End Centroid Longitude</th>\n",
" <th>End Centroid Location</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>3eb9a2a3-3266-4559-b1ec-e83a6f7972ab</td>\n",
" <td>08/12/2020 05:00:00 AM</td>\n",
" <td>08/12/2020 05:00:00 AM</td>\n",
" <td>1,153</td>\n",
" <td>1,027</td>\n",
" <td>spin</td>\n",
" <td>68.0</td>\n",
" <td>68.0</td>\n",
" <td>ENGLEWOOD</td>\n",
" <td>ENGLEWOOD</td>\n",
" <td>41.780068</td>\n",
" <td>-87.642266</td>\n",
" <td>POINT (-87.64226608 41.78006847)</td>\n",
" <td>41.780068</td>\n",
" <td>-87.642266</td>\n",
" <td>POINT (-87.64226608 41.78006847)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>82dd7b8f-8de0-4f25-829b-b32bf47e8419</td>\n",
" <td>08/12/2020 05:00:00 AM</td>\n",
" <td>08/12/2020 05:00:00 AM</td>\n",
" <td>17</td>\n",
" <td>91</td>\n",
" <td>spin</td>\n",
" <td>22.0</td>\n",
" <td>21.0</td>\n",
" <td>LOGAN SQUARE</td>\n",
" <td>AVONDALE</td>\n",
" <td>41.922903</td>\n",
" <td>-87.704301</td>\n",
" <td>POINT (-87.70430082 41.92290349)</td>\n",
" <td>41.939283</td>\n",
" <td>-87.710757</td>\n",
" <td>POINT (-87.71075685 41.93928256)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Trip ID Start Time \\\n",
"0 3eb9a2a3-3266-4559-b1ec-e83a6f7972ab 08/12/2020 05:00:00 AM \n",
"1 82dd7b8f-8de0-4f25-829b-b32bf47e8419 08/12/2020 05:00:00 AM \n",
"\n",
" End Time Trip Distance Trip Duration Vendor \\\n",
"0 08/12/2020 05:00:00 AM 1,153 1,027 spin \n",
"1 08/12/2020 05:00:00 AM 17 91 spin \n",
"\n",
" Start Community Area Number End Community Area Number \\\n",
"0 68.0 68.0 \n",
"1 22.0 21.0 \n",
"\n",
" Start Community Area Name End Community Area Name Start Centroid Latitude \\\n",
"0 ENGLEWOOD ENGLEWOOD 41.780068 \n",
"1 LOGAN SQUARE AVONDALE 41.922903 \n",
"\n",
" Start Centroid Longitude Start Centroid Location \\\n",
"0 -87.642266 POINT (-87.64226608 41.78006847) \n",
"1 -87.704301 POINT (-87.70430082 41.92290349) \n",
"\n",
" End Centroid Latitude End Centroid Longitude \\\n",
"0 41.780068 -87.642266 \n",
"1 41.939283 -87.710757 \n",
"\n",
" End Centroid Location \n",
"0 POINT (-87.64226608 41.78006847) \n",
"1 POINT (-87.71075685 41.93928256) "
]
},
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.head(2)"
]
},
{
"cell_type": "code",
"execution_count": 62,
"id": "3f056dce-a831-45de-8248-7e02fd953a7d",
"metadata": {
"id": "3f056dce-a831-45de-8248-7e02fd953a7d"
},
"outputs": [],
"source": [
"df = df.dropna()"
]
},
{
"cell_type": "code",
"execution_count": 57,
"id": "e90ac011-2b64-4d37-9ac8-aa1385fd3122",
"metadata": {
"id": "e90ac011-2b64-4d37-9ac8-aa1385fd3122"
},
"outputs": [],
"source": [
"df = df.astype({\"Start Community Area Number\": int, \"End Community Area Number\": int})"
]
},
{
"cell_type": "code",
"execution_count": 72,
"id": "f97344e1-77e2-4319-8ee1-183e735702da",
"metadata": {
"id": "f97344e1-77e2-4319-8ee1-183e735702da"
},
"outputs": [
{
"ename": "TypeError",
"evalue": "ufunc 'bitwise_or' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[72], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m communities \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mset\u001b[39m(\u001b[43mdf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mStart Community Area Number\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43munique\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m|\u001b[39;49m\u001b[43mdf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mEnd Community Area Number\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43munique\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m)\n",
"\u001b[1;31mTypeError\u001b[0m: ufunc 'bitwise_or' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''"
]
}
],
"source": [
"communities = set(df[\"Start Community Area Number\"].unique()|df[\"End Community Area Number\"].unique())"
]
},
{
"cell_type": "code",
"execution_count": 71,
"id": "b49a9aaf",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"77"
]
},
"execution_count": 71,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(communities)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "c403e385-1f00-4dbc-a867-25d2e11b07d5",
"metadata": {
"id": "c403e385-1f00-4dbc-a867-25d2e11b07d5"
},
"outputs": [
{
"data": {
"text/plain": [
"64"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(communities)"
]
},
{
"cell_type": "code",
"execution_count": 27,
"id": "d97b0ac8",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict_keys([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77])"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"community_groups = df.groupby(\"Start Community Area Number\")\n",
"community_groups.groups.keys()"
]
},
{
"cell_type": "code",
"execution_count": 28,
"id": "f38f6c51-859e-4a55-b6a5-20e68b18252a",
"metadata": {
"id": "f38f6c51-859e-4a55-b6a5-20e68b18252a"
},
"outputs": [],
"source": [
"df[\"Start Time\"] = pd.to_datetime(df[\"Start Time\"])"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "b0b94d62-a159-4b8c-98eb-a11b4ff4adcc",
"metadata": {
"id": "b0b94d62-a159-4b8c-98eb-a11b4ff4adcc"
},
"outputs": [],
"source": [
"df[\"End Time\"] = pd.to_datetime(df[\"End Time\"])"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "f960381b-e875-4d8e-bcf8-60f786128e28",
"metadata": {
"id": "f960381b-e875-4d8e-bcf8-60f786128e28",
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"Trip ID object\n",
"Start Time datetime64[ns]\n",
"End Time datetime64[ns]\n",
"Trip Distance object\n",
"Trip Duration object\n",
"Vendor object\n",
"Start Community Area Number int32\n",
"End Community Area Number int32\n",
"Start Community Area Name object\n",
"End Community Area Name object\n",
"Start Centroid Latitude float64\n",
"Start Centroid Longitude float64\n",
"Start Centroid Location object\n",
"End Centroid Latitude float64\n",
"End Centroid Longitude float64\n",
"End Centroid Location object\n",
"dtype: object"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df.dtypes"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "dde242e4-6720-40b4-9ddc-6f54d93cbb20",
"metadata": {
"id": "dde242e4-6720-40b4-9ddc-6f54d93cbb20"
},
"outputs": [
{
"data": {
"text/plain": [
"(Timestamp('2020-08-12 05:00:00'),\n",
" Timestamp('2020-12-12 21:00:00'),\n",
" Timestamp('2020-08-12 05:00:00'),\n",
" Timestamp('2020-12-12 22:00:00'))"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df[\"Start Time\"].min(), df[\"Start Time\"].max(), df[\"End Time\"].min(), df[\"End Time\"].max()"
]
},
{
"cell_type": "code",
"execution_count": 32,
"id": "e11d210a-d174-4529-925a-29ddc86bb9d6",
"metadata": {
"id": "e11d210a-d174-4529-925a-29ddc86bb9d6"
},
"outputs": [],
"source": [
"community_map = {key: value for value, key in enumerate(communities)}"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "f782954d-48ec-4c09-a3cb-2b2927cc0c98",
"metadata": {
"id": "f782954d-48ec-4c09-a3cb-2b2927cc0c98"
},
"outputs": [],
"source": [
"from datetime import datetime\n",
"start = datetime(year = 2020, month = 8, day = 12, hour = 0, minute = 0, second = 0)\n",
"end = datetime(year = 2020, month = 12, day = 12, hour = 0, minute = 0, second = 0)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"id": "d07ede9b-7a8d-4a1e-9eaf-432d2478f22b",
"metadata": {
"id": "d07ede9b-7a8d-4a1e-9eaf-432d2478f22b"
},
"outputs": [
{
"data": {
"text/plain": [
"(datetime.datetime(2020, 8, 12, 0, 0), datetime.datetime(2020, 12, 12, 0, 0))"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"start, end"
]
},
{
"cell_type": "code",
"execution_count": 35,
"id": "1a9b13f8-2a1f-4eef-8503-993a753e5606",
"metadata": {
"id": "1a9b13f8-2a1f-4eef-8503-993a753e5606"
},
"outputs": [
{
"data": {
"text/plain": [
"2928.0"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(end - start).total_seconds()/(60 * 60)"
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "f3dedc91-bf17-4f7a-81c2-a3d3648a4d72",
"metadata": {
"id": "f3dedc91-bf17-4f7a-81c2-a3d3648a4d72"
},
"outputs": [
{
"data": {
"text/plain": [
"2952"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"2928 + 24"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "baaab069",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 37,
"id": "8ad49821-b152-4227-81fb-40b2687d71c8",
"metadata": {
"id": "8ad49821-b152-4227-81fb-40b2687d71c8"
},
"outputs": [],
"source": [
"df[\"start_midx\"] = df[\"Start Community Area Number\"].map(community_map)\n",
"df[\"end_midx\"] = df[\"End Community Area Number\"].map(community_map)"
]
},
{
"cell_type": "code",
"execution_count": 38,
"id": "93d4c5cb-a009-49ab-9631-0b90dd06dad0",
"metadata": {
"id": "93d4c5cb-a009-49ab-9631-0b90dd06dad0"
},
"outputs": [],
"source": [
"start_trips = pd.DataFrame(df.groupby([\"Start Time\", \"start_midx\"])[\"Trip ID\"].count())"
]
},
{
"cell_type": "code",
"execution_count": 43,
"id": "9dd74720",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>Trip ID</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Start Time</th>\n",
" <th>start_midx</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">2020-08-12 05:00:00</th>\n",
" <th>15.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>35.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">2020-08-12 08:00:00</th>\n",
" <th>10.0</th>\n",
" <td>3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>25.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2020-08-12 09:00:00</th>\n",
" <th>2.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"4\" valign=\"top\">2020-12-12 20:00:00</th>\n",
" <th>10.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>18.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>20.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>37.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2020-12-12 21:00:00</th>\n",
" <th>22.0</th>\n",
" <td>1</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>34256 rows × 1 columns</p>\n",
"</div>"
],
"text/plain": [
" Trip ID\n",
"Start Time start_midx \n",
"2020-08-12 05:00:00 15.0 1\n",
" 35.0 1\n",
"2020-08-12 08:00:00 10.0 3\n",
" 25.0 1\n",
"2020-08-12 09:00:00 2.0 1\n",
"... ...\n",
"2020-12-12 20:00:00 10.0 1\n",
" 18.0 1\n",
" 20.0 1\n",
" 37.0 1\n",
"2020-12-12 21:00:00 22.0 1\n",
"\n",
"[34256 rows x 1 columns]"
]
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"start_trips"
]
},
{
"cell_type": "code",
"execution_count": 39,
"id": "b543c975-204b-4c2c-acd8-75bab929da80",
"metadata": {
"id": "b543c975-204b-4c2c-acd8-75bab929da80"
},
"outputs": [],
"source": [
"end_trips = pd.DataFrame(df.groupby([\"End Time\", \"end_midx\"])[\"Trip ID\"].count())"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "f9651eea-5181-4ae5-a342-6e622076ae02",
"metadata": {
"id": "f9651eea-5181-4ae5-a342-6e622076ae02"
},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'trips' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[40], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mtrips\u001b[49m\u001b[38;5;241m.\u001b[39mloc[(y[\u001b[38;5;241m0\u001b[39m], \u001b[38;5;241m15\u001b[39m)][\u001b[38;5;241m0\u001b[39m]\n",
"\u001b[1;31mNameError\u001b[0m: name 'trips' is not defined"
]
}
],
"source": [
"trips.loc[(y[0], 15)][0]"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "fe68a2f9-034d-4aea-9fa8-ac147f88a1c8",
"metadata": {
"id": "fe68a2f9-034d-4aea-9fa8-ac147f88a1c8"
},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'np' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[41], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m in_map \u001b[38;5;241m=\u001b[39m \u001b[43mnp\u001b[49m\u001b[38;5;241m.\u001b[39mzeros(\u001b[38;5;241m64\u001b[39m)\n",
"\u001b[1;31mNameError\u001b[0m: name 'np' is not defined"
]
}
],
"source": [
"in_map = np.zeros(64)"
]
},
{
"cell_type": "code",
"execution_count": 42,
"id": "e118c0a4-60e4-413a-8d12-39ca32f646aa",
"metadata": {
"id": "e118c0a4-60e4-413a-8d12-39ca32f646aa"
},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'in_map' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[42], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43min_map\u001b[49m\u001b[38;5;241m.\u001b[39mreshape(\u001b[38;5;241m8\u001b[39m,\u001b[38;5;241m8\u001b[39m)\n",
"\u001b[1;31mNameError\u001b[0m: name 'in_map' is not defined"
]
}
],
"source": [
"in_map.reshape(8,8)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "175845f6-2893-49f6-a7a8-4f24f17db903",
"metadata": {
"id": "175845f6-2893-49f6-a7a8-4f24f17db903"
},
"outputs": [],
"source": [
"from datetime import datetime, timedelta\n",
"import numpy as np\n",
"\n",
"timeslots = []\n",
"time_clips = []\n",
"\n",
"for i in range(2952):\n",
" time = start + timedelta(hours=i)\n",
" timeslots.append(time)\n",
" check_in_map = np.zeros(64)\n",
" check_out_map = np.zeros(64)\n",
" for j in range(64):\n",
" try:\n",
" check_in_map[j] = start_trips.loc[(time, j)][0]\n",
" except:\n",
" continue\n",
"\n",
" try:\n",
" check_out_map[j] = end_trips.loc[(time, j)][0]\n",
" except:\n",
" continue\n",
"\n",
" check_in_map = check_in_map.reshape(8, 8)\n",
" check_out_map = check_out_map.reshape(8, 8)\n",
"\n",
" time_clips.append((check_in_map, check_out_map))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fac14eaa-6b8a-404c-a3a7-6d2342836646",
"metadata": {
"id": "fac14eaa-6b8a-404c-a3a7-6d2342836646"
},
"outputs": [],
"source": [
"timeslots[-1]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1cc1205f-8246-425e-9435-0b9011cca921",
"metadata": {
"id": "1cc1205f-8246-425e-9435-0b9011cca921"
},
"outputs": [],
"source": [
"data = np.array(time_clips)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "35867474-d779-4eaa-b0ad-864bb2a41e65",
"metadata": {
"id": "35867474-d779-4eaa-b0ad-864bb2a41e65"
},
"outputs": [],
"source": [
"data.shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "74442b4c-ed9a-4baa-8bb6-6b2527ff08fc",
"metadata": {
"id": "74442b4c-ed9a-4baa-8bb6-6b2527ff08fc"
},
"outputs": [],
"source": [
"np.save(\"./scooter_data\", data)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "44960cb7-8949-4df2-99a5-d00865e94004",
"metadata": {
"id": "44960cb7-8949-4df2-99a5-d00865e94004"
},
"outputs": [],
"source": [
"data = np.load(\"./scooter_data.npy\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "237ec1ab-7fb7-41b1-b9bf-07808cf2e38d",
"metadata": {
"id": "237ec1ab-7fb7-41b1-b9bf-07808cf2e38d"
},
"outputs": [],
"source": []
}
],
"metadata": {
"colab": {
"provenance": []
},
"kernelspec": {
"display_name": "py310",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}