{ "cells": [ { "cell_type": "markdown", "id": "0b211ca8-bd70-46fc-b7b1-7c7e6bdcfe5e", "metadata": {}, "source": [ "# Wind Rose\n", "\n", "The notebook is inspired by [this plot](https://mesonet.cdn.columbiascanner.org/onsite/windrose/IA_ASOS/PEA/PEA_yearly.png)." ] }, { "cell_type": "code", "execution_count": 1, "id": "a5ae369f-2486-4e7c-81c4-79ed555154d5", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:21:00.879537Z", "iopub.status.busy": "2024-04-26T12:21:00.879537Z", "iopub.status.idle": "2024-04-26T12:21:01.856236Z", "shell.execute_reply": "2024-04-26T12:21:01.856236Z" } }, "outputs": [], "source": [ "import pandas as pd\n", "\n", "from lets_plot import *\n", "from lets_plot.mapping import as_discrete" ] }, { "cell_type": "code", "execution_count": 2, "id": "bfdcdd13-23ea-4a38-be8f-561192a555db", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:21:01.856236Z", "iopub.status.busy": "2024-04-26T12:21:01.856236Z", "iopub.status.idle": "2024-04-26T12:21:01.872922Z", "shell.execute_reply": "2024-04-26T12:21:01.872013Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 3, "id": "ccdb0b79-81d3-4d64-a208-0cd76765df50", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:21:01.874231Z", "iopub.status.busy": "2024-04-26T12:21:01.874231Z", "iopub.status.idle": "2024-04-26T12:21:06.874570Z", "shell.execute_reply": "2024-04-26T12:21:06.874570Z" } }, "outputs": [], "source": [ "wind_df = pd.read_csv(\"https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/pea_wind.csv\")\n", "records_count = wind_df.shape[0]" ] }, { "cell_type": "code", "execution_count": 4, "id": "76ab511d-673c-40ba-abc0-12b88db98f5e", "metadata": { "execution": { "iopub.execute_input": "2024-04-26T12:21:06.874570Z", "iopub.status.busy": "2024-04-26T12:21:06.874570Z", "iopub.status.idle": "2024-04-26T12:21:07.901771Z", "shell.execute_reply": "2024-04-26T12:21:07.901771Z" } }, "outputs": [ { "data": { "text/html": [ "\n", " | station | \n", "valid | \n", "drct | \n", "sped | \n", "
---|---|---|---|---|
0 | \n", "PEA | \n", "2002-05-17 00:14 | \n", "330.0 | \n", "8.05 | \n", "
1 | \n", "PEA | \n", "2002-05-17 00:20 | \n", "330.0 | \n", "8.05 | \n", "
2 | \n", "PEA | \n", "2002-05-17 00:34 | \n", "340.0 | \n", "10.35 | \n", "
3 | \n", "PEA | \n", "2002-05-17 00:40 | \n", "340.0 | \n", "10.35 | \n", "
4 | \n", "PEA | \n", "2002-05-17 00:54 | \n", "340.0 | \n", "14.95 | \n", "