{ "cells": [ { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [], "source": [ "from river import datasets\n", "import pandas as pd\n" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Bike sharing station information from the city of Toulouse.\n", "\n", "The goal is to predict the number of bikes in 5 different bike stations from the city of\n", "Toulouse.\n", "\n", " Name Bikes \n", " Task Regression \n", " Samples 182,470 \n", " Features 8 \n", " Sparse False \n", " Path /Users/dhaval/river_data/Bikes/toulouse_bikes.csv \n", " URL https://maxhalford.github.io/files/datasets/toulouse_bikes.zip\n", " Size 12.52 MB \n", "Downloaded True " ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset = datasets.Bikes()\n", "dataset" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [], "source": [ "train_df_X = []\n", "train_df_y = []\n", "for X, y in iter(dataset):\n", " train_df_X.append(X)\n", " train_df_y.append(y)" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [], "source": [ "train_df = pd.DataFrame(train_df_X)" ] }, { "cell_type": "code", "execution_count": 59, "metadata": {}, "outputs": [], "source": [ "train_df[\"target\"] = train_df_y" ] }, { "cell_type": "code", "execution_count": 60, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
momentstationcloudsdescriptionhumiditypressuretemperaturewindtarget
02016-04-01 00:00:07metro-canal-du-midi75light rain811017.006.549.301
12016-04-01 00:00:16place-des-carmes75light rain811017.006.549.303
22016-04-01 00:00:35place-des-carmes75light rain811017.006.549.303
32016-04-01 00:04:50place-esquirol75light rain811017.006.549.302
42016-04-01 00:05:29place-esquirol75light rain811017.006.549.302
..............................
1824652016-10-05 09:53:00pomme88overcast clouds841017.3417.451.9512
1824662016-10-05 09:53:27place-esquirol88overcast clouds841017.3417.451.9532
1824672016-10-05 09:53:39metro-canal-du-midi88overcast clouds841017.3417.451.955
1824682016-10-05 09:54:04pomme88overcast clouds841017.3417.451.9511
1824692016-10-05 09:57:18pomme88overcast clouds841017.3417.451.9512
\n", "

182470 rows × 9 columns

\n", "
" ], "text/plain": [ " moment station clouds description \\\n", "0 2016-04-01 00:00:07 metro-canal-du-midi 75 light rain \n", "1 2016-04-01 00:00:16 place-des-carmes 75 light rain \n", "2 2016-04-01 00:00:35 place-des-carmes 75 light rain \n", "3 2016-04-01 00:04:50 place-esquirol 75 light rain \n", "4 2016-04-01 00:05:29 place-esquirol 75 light rain \n", "... ... ... ... ... \n", "182465 2016-10-05 09:53:00 pomme 88 overcast clouds \n", "182466 2016-10-05 09:53:27 place-esquirol 88 overcast clouds \n", "182467 2016-10-05 09:53:39 metro-canal-du-midi 88 overcast clouds \n", "182468 2016-10-05 09:54:04 pomme 88 overcast clouds \n", "182469 2016-10-05 09:57:18 pomme 88 overcast clouds \n", "\n", " humidity pressure temperature wind target \n", "0 81 1017.00 6.54 9.30 1 \n", "1 81 1017.00 6.54 9.30 3 \n", "2 81 1017.00 6.54 9.30 3 \n", "3 81 1017.00 6.54 9.30 2 \n", "4 81 1017.00 6.54 9.30 2 \n", "... ... ... ... ... ... \n", "182465 84 1017.34 17.45 1.95 12 \n", "182466 84 1017.34 17.45 1.95 32 \n", "182467 84 1017.34 17.45 1.95 5 \n", "182468 84 1017.34 17.45 1.95 11 \n", "182469 84 1017.34 17.45 1.95 12 \n", "\n", "[182470 rows x 9 columns]" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "train_df" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "train_df.to_csv(\"/data/Bikes.csv\", index=False)" ] } ], "metadata": { "kernelspec": { "display_name": "sail", "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.10" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }