{ "cells": [ { "cell_type": "markdown", "id": "58041ec7-6bbf-4fa8-b76d-1f4af1a3cccd", "metadata": {}, "source": [ "Importing pandas, a leading data manipulation python library" ] }, { "cell_type": "code", "execution_count": 1, "id": "7c04b7c9-fd43-4f0c-91e5-bfca643d0bb6", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "markdown", "id": "92d05092-b42f-4943-bc7d-eff9db6198eb", "metadata": {}, "source": [ "Reading in the data set." ] }, { "cell_type": "code", "execution_count": 2, "id": "32b6b294-acf7-411a-aee6-affd819fbc04", "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv('raw/data.csv', names=['station_id', 'bike_id', 'from', 'to'])" ] }, { "cell_type": "markdown", "id": "3980c0e3-1d94-4ccd-b863-c63e11561963", "metadata": {}, "source": [ "Observing the data set" ] }, { "cell_type": "code", "execution_count": 3, "id": "c35503ec-e37c-4397-8e0d-8968fa18c70a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "pandas.core.frame.DataFrame" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "type(df)" ] }, { "cell_type": "code", "execution_count": 4, "id": "baaa8207-6042-43cf-8433-d371238eac86", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1000" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df)" ] }, { "cell_type": "code", "execution_count": 5, "id": "c812ac6a-47cc-4f61-8612-a8e704fcfb66", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1000, 4)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.shape" ] }, { "cell_type": "code", "execution_count": 6, "id": "8987a405-9b2b-43bf-a049-aed7c21880f1", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
| \n", " | station_id | \n", "bike_id | \n", "from | \n", "to | \n", "
|---|---|---|---|---|
| 0 | \n", "212 | \n", "2294 | \n", "2020-12-13T11:26:54Z | \n", "2020-12-17T16:13:54Z | \n", "
| 1 | \n", "418 | \n", "3441 | \n", "2020-08-25T11:37:11Z | \n", "2020-08-31T11:18:11Z | \n", "
| 2 | \n", "301 | \n", "6467 | \n", "2021-04-10T17:05:16Z | \n", "2021-04-11T15:00:16Z | \n", "
| 3 | \n", "560 | \n", "9386 | \n", "2021-04-28T12:10:24Z | \n", "2021-05-02T07:31:24Z | \n", "
| 4 | \n", "87 | \n", "8755 | \n", "2021-01-10T10:40:53Z | \n", "2021-01-11T20:58:53Z | \n", "
| 5 | \n", "651 | \n", "1525 | \n", "2020-08-08T06:44:20Z | \n", "2020-08-11T01:15:20Z | \n", "
| 6 | \n", "40 | \n", "8238 | \n", "2021-01-16T10:20:47Z | \n", "2021-01-16T14:06:47Z | \n", "
| 7 | \n", "97 | \n", "2437 | \n", "2021-06-21T15:52:08Z | \n", "2021-06-24T00:56:08Z | \n", "
| 8 | \n", "362 | \n", "8428 | \n", "2021-03-12T16:38:10Z | \n", "2021-03-17T05:07:10Z | \n", "
| 9 | \n", "234 | \n", "7266 | \n", "2021-01-02T19:17:57Z | \n", "2021-01-08T01:42:57Z | \n", "