{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Time Series Visualizations\n", "\n", "This notebook demonstrates how to use Lets-Plot to investigate time series.\n", "\n", "The data is provided by [Kaggle](https://www.kaggle.com/sumanthvrao/daily-climate-time-series-data)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:54:40.086488Z", "iopub.status.busy": "2025-11-05T13:54:40.086394Z", "iopub.status.idle": "2025-11-05T13:54:40.089735Z", "shell.execute_reply": "2025-11-05T13:54:40.089547Z" } }, "outputs": [], "source": [ "import pandas as pd\n", "\n", "from lets_plot import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:54:40.090720Z", "iopub.status.busy": "2025-11-05T13:54:40.090643Z", "iopub.status.idle": "2025-11-05T13:54:40.092489Z", "shell.execute_reply": "2025-11-05T13:54:40.092265Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Preparation" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:54:40.105386Z", "iopub.status.busy": "2025-11-05T13:54:40.105303Z", "iopub.status.idle": "2025-11-05T13:54:40.474326Z", "shell.execute_reply": "2025-11-05T13:54:40.473875Z" } }, "outputs": [], "source": [ "df = pd.read_csv(\"https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/delhi_climate.csv\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:54:40.475736Z", "iopub.status.busy": "2025-11-05T13:54:40.475644Z", "iopub.status.idle": "2025-11-05T13:54:40.479860Z", "shell.execute_reply": "2025-11-05T13:54:40.479613Z" } }, "outputs": [], "source": [ "df = df.rename(columns={\"meantemp\": \"mean temperature\", \"wind_speed\": \"wind speed\"})\n", "df.date = pd.to_datetime(df.date)\n", "df[\"day\"] = df.date.dt.day\n", "df[\"month\"] = df.date.dt.month\n", "df[\"year\"] = df.date.dt.year\n", "df = df[df.year < 2017]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### General Information" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2025-11-05T13:54:40.480852Z", "iopub.status.busy": "2025-11-05T13:54:40.480747Z", "iopub.status.idle": "2025-11-05T13:54:40.524526Z", "shell.execute_reply": "2025-11-05T13:54:40.524273Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "