{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:34:53.541409Z", "iopub.status.busy": "2024-04-17T07:34:53.541308Z", "iopub.status.idle": "2024-04-17T07:34:53.865151Z", "shell.execute_reply": "2024-04-17T07:34:53.864864Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "\n", "from lets_plot import *\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:34:53.878940Z", "iopub.status.busy": "2024-04-17T07:34:53.878785Z", "iopub.status.idle": "2024-04-17T07:34:53.880670Z", "shell.execute_reply": "2024-04-17T07:34:53.880327Z" } }, "outputs": [], "source": [ "np.random.seed(42)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:34:53.881864Z", "iopub.status.busy": "2024-04-17T07:34:53.881708Z", "iopub.status.idle": "2024-04-17T07:34:53.883623Z", "shell.execute_reply": "2024-04-17T07:34:53.883438Z" } }, "outputs": [], "source": [ "x_a = np.random.normal(-0.5, 1, 100)\n", "y_a = np.random.normal(0, 1, 100)\n", "cat_a = ['A' for x in range(100)]\n", "\n", "x_b = np.random.normal(0.5, 1, 100)\n", "y_b = np.random.normal(0, 1, 100)\n", "cat_b = ['B' for x in range(100)]" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:34:53.884745Z", "iopub.status.busy": "2024-04-17T07:34:53.884559Z", "iopub.status.idle": "2024-04-17T07:34:53.886221Z", "shell.execute_reply": "2024-04-17T07:34:53.886039Z" } }, "outputs": [], "source": [ "data = {}\n", "data['x'] = np.concatenate((x_a, x_b))\n", "data['y'] = np.concatenate((y_a, y_b))\n", "data['cat'] = np.concatenate((cat_a, cat_b))" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:34:53.887081Z", "iopub.status.busy": "2024-04-17T07:34:53.887005Z", "iopub.status.idle": "2024-04-17T07:34:53.920060Z", "shell.execute_reply": "2024-04-17T07:34:53.919855Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "