{ "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-06-03T14:12:08.851344Z", "iopub.status.busy": "2024-06-03T14:12:08.851253Z", "iopub.status.idle": "2024-06-03T14:12:09.170647Z", "shell.execute_reply": "2024-06-03T14:12:09.170297Z" } }, "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-06-03T14:12:09.172231Z", "iopub.status.busy": "2024-06-03T14:12:09.172106Z", "iopub.status.idle": "2024-06-03T14:12:09.173989Z", "shell.execute_reply": "2024-06-03T14:12:09.173803Z" } }, "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-06-03T14:12:09.175109Z", "iopub.status.busy": "2024-06-03T14:12:09.175036Z", "iopub.status.idle": "2024-06-03T14:12:12.483009Z", "shell.execute_reply": "2024-06-03T14:12:12.482644Z" } }, "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-06-03T14:12:12.484536Z", "iopub.status.busy": "2024-06-03T14:12:12.484458Z", "iopub.status.idle": "2024-06-03T14:12:12.950409Z", "shell.execute_reply": "2024-06-03T14:12:12.949869Z" } }, "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", "