{ "cells": [ { "cell_type": "code", "execution_count": 67, "metadata": { "id": "iNgLgZ27Dlq6" }, "outputs": [], "source": [ "from huggingface_hub import list_models, list_spaces\n", "from pathlib import Path\n", "from toolz import concat\n", "from datasets import Dataset\n", "import polars as pl\n", "from datetime import date\n", "from datetime import date, timedelta\n", "from datasets import load_dataset\n", "import plotly.express as px\n", "import os" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "HF_TOKEN = os.getenv(\"HF_TOKEN\")" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "id": "mBMDThV4FA3m" }, "outputs": [], "source": [ "def yield_models():\n", " for model in iter(list_models(full=True)):\n", " yield \"model\", model" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "id": "hDqiwFD3uTR8" }, "outputs": [], "source": [ "def yield_spaces():\n", " for space in iter(list_spaces(full=True)):\n", " yield \"space\", space" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "id": "mZEhftoNFHGN" }, "outputs": [], "source": [ "def yield_notebooks():\n", " for repo_type, repo in concat([yield_models(), yield_spaces()]):\n", " files = (f.rfilename for f in repo.siblings)\n", " if jupyter_notebook := [f for f in files if Path(f).suffix == \".ipynb\"]:\n", " yield {\n", " \"date\": date.today(),\n", " \"repo_type\": repo_type,\n", " \"repo_id\": repo.id,\n", " \"repo_notebook_count\": len(jupyter_notebook),\n", " }" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [], "source": [ "df = pl.LazyFrame(yield_notebooks())" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "df = (\n", " df.with_columns(pl.col(\"repo_id\").str.split_exact(\"/\", 1))\n", " .unnest(\"repo_id\")\n", " .rename({\"field_0\": \"user\", \"field_1\": \"repo_id\"})\n", ")" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "by_user_count = (\n", " df.groupby(\"user\")\n", " .agg(pl.col(\"repo_notebook_count\").sum())\n", " .sort(\"repo_notebook_count\", descending=True)\n", " .collect()\n", ")" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "shape: (1540, 2)
userrepo_notebook_count
stri64
"gradio-pr-depl…1798
"gradio"414
"sgoodfriend"240
"merve"63
"chrisjay"62
"infinitejoy"32
"fabricius"29
"aammari"26
"flax-community…24
"rajesh1729"24
"gabri14el"23
"srush"23
"fredbrito"1
"JimmyLee08"1
"BenjaminFraser…1
"MRamzam"1
"Deepak107"1
"ozyman"1
"ELIA"1
"zaidmukaddam"1
"Jack003"1
"SiddhantOjha"1
"lowrollr"1
"edwardpraveen"1
" ], "text/plain": [ "shape: (1540, 2)\n", "┌───────────────────┬─────────────────────┐\n", "│ user ┆ repo_notebook_count │\n", "│ --- ┆ --- │\n", "│ str ┆ i64 │\n", "╞═══════════════════╪═════════════════════╡\n", "│ gradio-pr-deploys ┆ 1798 │\n", "│ gradio ┆ 414 │\n", "│ sgoodfriend ┆ 240 │\n", "│ merve ┆ 63 │\n", "│ … ┆ … │\n", "│ Jack003 ┆ 1 │\n", "│ SiddhantOjha ┆ 1 │\n", "│ lowrollr ┆ 1 │\n", "│ edwardpraveen ┆ 1 │\n", "└───────────────────┴─────────────────────┘" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "by_user_count" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "shape: (7, 3)
describeuserrepo_notebook_count
strstrf64
"count""1540"1540.0
"null_count""0"0.0
"mean"null3.787013
"std"null47.455407
"min""007aneesh"1.0
"max""zinoubm"1798.0
"median"null1.0
" ], "text/plain": [ "shape: (7, 3)\n", "┌────────────┬───────────┬─────────────────────┐\n", "│ describe ┆ user ┆ repo_notebook_count │\n", "│ --- ┆ --- ┆ --- │\n", "│ str ┆ str ┆ f64 │\n", "╞════════════╪═══════════╪═════════════════════╡\n", "│ count ┆ 1540 ┆ 1540.0 │\n", "│ null_count ┆ 0 ┆ 0.0 │\n", "│ mean ┆ null ┆ 3.787013 │\n", "│ std ┆ null ┆ 47.455407 │\n", "│ min ┆ 007aneesh ┆ 1.0 │\n", "│ max ┆ zinoubm ┆ 1798.0 │\n", "│ median ┆ null ┆ 1.0 │\n", "└────────────┴───────────┴─────────────────────┘" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "by_user_count.describe()" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "shape: (1, 1)
mean notebooks per user
f64
3.787013
" ], "text/plain": [ "shape: (1, 1)\n", "┌──────────────────────────┐\n", "│ mean notebooks per user │\n", "│ --- │\n", "│ f64 │\n", "╞══════════════════════════╡\n", "│ 3.787013 │\n", "└──────────────────────────┘" ] }, "execution_count": 31, "metadata": {}, "output_type": "execute_result" } ], "source": [ "by_user_count.mean().select(\n", " pl.col(\"repo_notebook_count\").alias(\"mean notebooks per user\")\n", ")" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Dataset({\n", " features: ['user', 'repo_notebook_count'],\n", " num_rows: 1540\n", "})" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ds = Dataset(by_user_count.to_arrow())\n", "ds" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Creating parquet from Arrow format: 100%|██████████| 2/2 [00:00<00:00, 617.08ba/s]\n", "Upload 1 LFS files: 100%|██████████| 1/1 [00:00<00:00, 1.05it/s]\n", "Pushing dataset shards to the dataset hub: 100%|██████████| 1/1 [00:02<00:00, 2.39s/it]\n", "Deleting unused files from dataset repository: 100%|██████████| 1/1 [00:00<00:00, 2.01it/s]\n", "Downloading metadata: 100%|██████████| 406/406 [00:00<00:00, 126kB/s]\n", "Updating downloaded metadata with the new split.\n" ] } ], "source": [ "ds.push_to_hub(\"davanstrien/notebooks_by_user\", token=HF_TOKEN)" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "id": "h6AaHRSCV397" }, "outputs": [], "source": [ "grouped = df.groupby(\"repo_type\").agg(pl.col(\"repo_notebook_count\").sum())" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "shape: (2, 3)
repo_typerepo_notebook_countdate
stri64date
"space"44432023-03-30
"model"13892023-03-30
" ], "text/plain": [ "shape: (2, 3)\n", "┌───────────┬─────────────────────┬────────────┐\n", "│ repo_type ┆ repo_notebook_count ┆ date │\n", "│ --- ┆ --- ┆ --- │\n", "│ str ┆ i64 ┆ date │\n", "╞═══════════╪═════════════════════╪════════════╡\n", "│ space ┆ 4443 ┆ 2023-03-30 │\n", "│ model ┆ 1389 ┆ 2023-03-30 │\n", "└───────────┴─────────────────────┴────────────┘" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "final_df = grouped.with_columns(pl.lit(date.today()).alias(\"date\")).collect()\n", "final_df" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Downloading readme: 100%|██████████| 441/441 [00:00<00:00, 130kB/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Downloading and preparing dataset None/None to /Users/davanstrien/.cache/huggingface/datasets/davanstrien___parquet/davanstrien--notebooks_by_repo_type-1004c11b0535dac5/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Downloading data: 100%|██████████| 1.87k/1.87k [00:00<00:00, 705kB/s]\n", "Downloading data files: 100%|██████████| 1/1 [00:01<00:00, 1.71s/it]\n", "Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 786.78it/s]\n", " " ] }, { "name": "stdout", "output_type": "stream", "text": [ "Dataset parquet downloaded and prepared to /Users/davanstrien/.cache/huggingface/datasets/davanstrien___parquet/davanstrien--notebooks_by_repo_type-1004c11b0535dac5/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec. Subsequent calls will reuse this data.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\r" ] }, { "data": { "text/html": [ "
\n", "shape: (7, 3)
repo_typerepo_notebook_countdate
stri64date
"space"39562023-03-27
"model"13462023-03-27
"model"13482023-03-28
"space"43862023-03-28
"space"44222023-03-28
"space"45792023-03-29
"model"13842023-03-29
" ], "text/plain": [ "shape: (7, 3)\n", "┌───────────┬─────────────────────┬────────────┐\n", "│ repo_type ┆ repo_notebook_count ┆ date │\n", "│ --- ┆ --- ┆ --- │\n", "│ str ┆ i64 ┆ date │\n", "╞═══════════╪═════════════════════╪════════════╡\n", "│ space ┆ 3956 ┆ 2023-03-27 │\n", "│ model ┆ 1346 ┆ 2023-03-27 │\n", "│ model ┆ 1348 ┆ 2023-03-28 │\n", "│ space ┆ 4386 ┆ 2023-03-28 │\n", "│ space ┆ 4422 ┆ 2023-03-28 │\n", "│ space ┆ 4579 ┆ 2023-03-29 │\n", "│ model ┆ 1384 ┆ 2023-03-29 │\n", "└───────────┴─────────────────────┴────────────┘" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "previous_df = pl.DataFrame(\n", " load_dataset(\"davanstrien/notebooks_by_repo_type\", split=\"train\").data.table\n", ")\n", "previous_df" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [], "source": [ "final_df = pl.concat([previous_df, final_df]).unique()" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [], "source": [ "spaces = final_df.filter(pl.col(\"repo_type\") == \"space\").unique(subset=[\"date\"])\n", "models = final_df.filter(pl.col(\"repo_type\") == \"model\").unique(subset=[\"date\"])" ] }, { "cell_type": "code", "execution_count": 58, "metadata": {}, "outputs": [], "source": [ "final_df = pl.concat([spaces, models]).unique()" ] }, { "cell_type": "code", "execution_count": 62, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "shape: (8, 3)
repo_typerepo_notebook_countdate
stri64date
"space"39562023-03-27
"model"13462023-03-27
"space"43862023-03-28
"model"13482023-03-28
"space"45792023-03-29
"model"13842023-03-29
"space"44432023-03-30
"model"13892023-03-30
" ], "text/plain": [ "shape: (8, 3)\n", "┌───────────┬─────────────────────┬────────────┐\n", "│ repo_type ┆ repo_notebook_count ┆ date │\n", "│ --- ┆ --- ┆ --- │\n", "│ str ┆ i64 ┆ date │\n", "╞═══════════╪═════════════════════╪════════════╡\n", "│ space ┆ 3956 ┆ 2023-03-27 │\n", "│ model ┆ 1346 ┆ 2023-03-27 │\n", "│ space ┆ 4386 ┆ 2023-03-28 │\n", "│ model ┆ 1348 ┆ 2023-03-28 │\n", "│ space ┆ 4579 ┆ 2023-03-29 │\n", "│ model ┆ 1384 ┆ 2023-03-29 │\n", "│ space ┆ 4443 ┆ 2023-03-30 │\n", "│ model ┆ 1389 ┆ 2023-03-30 │\n", "└───────────┴─────────────────────┴────────────┘" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "final_df = final_df.sort(\"date\")\n", "final_df" ] }, { "cell_type": "code", "execution_count": 55, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "final_df.groupby(\"repo_type\")" ] }, { "cell_type": "code", "execution_count": 63, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Creating parquet from Arrow format: 100%|██████████| 1/1 [00:00<00:00, 730.46ba/s]\n", "Upload 1 LFS files: 100%|██████████| 1/1 [00:00<00:00, 1.26it/s]\n", "Pushing dataset shards to the dataset hub: 100%|██████████| 1/1 [00:02<00:00, 2.14s/it]\n", "Deleting unused files from dataset repository: 100%|██████████| 1/1 [00:00<00:00, 1.87it/s]\n", "Downloading metadata: 100%|██████████| 441/441 [00:00<00:00, 173kB/s]\n", "Updating downloaded metadata with the new split.\n" ] } ], "source": [ "Dataset(final_df.to_arrow()).push_to_hub(\n", " \"davanstrien/notebooks_by_repo_type\", token=HF_TOKEN\n", ")" ] }, { "cell_type": "code", "execution_count": 73, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 224 }, "id": "T3vhuLpgdyKh", "outputId": "82a58845-ec9f-40d7-cbad-abddf7ad467a" }, "outputs": [], "source": [ "final_df = final_df.sort(\"date\")\n", "pandas_df = final_df.to_pandas()" ] }, { "cell_type": "code", "execution_count": 65, "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", "
repo_typerepo_notebook_count
date
2023-03-27space3956
2023-03-27model1346
2023-03-28space4386
2023-03-28model1348
2023-03-29space4579
2023-03-29model1384
2023-03-30space4443
2023-03-30model1389
\n", "
" ], "text/plain": [ " repo_type repo_notebook_count\n", "date \n", "2023-03-27 space 3956\n", "2023-03-27 model 1346\n", "2023-03-28 space 4386\n", "2023-03-28 model 1348\n", "2023-03-29 space 4579\n", "2023-03-29 model 1384\n", "2023-03-30 space 4443\n", "2023-03-30 model 1389" ] }, "execution_count": 65, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# final_df.to_pandas().set_index(\"date\", drop=True).sort_index()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 66, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "repo_type=space
date=%{x}
repo_notebook_count=%{y}", "legendgroup": "space", "line": { "color": "#636efa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "space", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2023-03-27T00:00:00", "2023-03-28T00:00:00", "2023-03-29T00:00:00", "2023-03-30T00:00:00" ], "xaxis": "x", "y": [ 3956, 4386, 4579, 4443 ], "yaxis": "y" }, { "hovertemplate": "repo_type=model
date=%{x}
repo_notebook_count=%{y}", "legendgroup": "model", "line": { "color": "#EF553B", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "model", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2023-03-27T00:00:00", "2023-03-28T00:00:00", "2023-03-29T00:00:00", "2023-03-30T00:00:00" ], "xaxis": "x", "y": [ 1346, 1348, 1384, 1389 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "repo_type" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "date" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "repo_notebook_count" } } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "px.line(pandas_df, x=\"date\", y=\"repo_notebook_count\", color=\"repo_type\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "colab": { "name": "scratchpad", "provenance": [] }, "kernelspec": { "display_name": "Python 3", "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.11.2" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "0b7aa472a433465bbe03d9f5a596d07c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_590d7059bf1e4c5285ca40e5298b7ee7", "IPY_MODEL_a82a83de315c43f6b7f9fa787227b2e3", "IPY_MODEL_4f66bea4e3ce4f508a407788729c958e" ], "layout": "IPY_MODEL_190d66e96c4b427e998fc412dd2bbd7b" } }, "190d66e96c4b427e998fc412dd2bbd7b": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": "hidden", "width": null } }, "266a59ce352c4a65aea3c6e8402ac1ed": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "4c31add106194a728e308ed486fc2e54": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "ProgressStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "bar_color": null, "description_width": "" } }, "4f66bea4e3ce4f508a407788729c958e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_266a59ce352c4a65aea3c6e8402ac1ed", "placeholder": "​", "style": "IPY_MODEL_c28bf5f9ac624739a48d62510d3bb05d", "value": " 2490/0 [02:11<00:00, 236.08 examples/s]" } }, "590d7059bf1e4c5285ca40e5298b7ee7": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_711a5f5d14ac4af180b54954e814f394", "placeholder": "​", "style": "IPY_MODEL_605acdd7a4cb4f118951fc79933f62f6", "value": "Generating train split: " } }, "605acdd7a4cb4f118951fc79933f62f6": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } }, "711a5f5d14ac4af180b54954e814f394": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "a82a83de315c43f6b7f9fa787227b2e3": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "info", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_c13a0581f0ff46c4a399627cd8aa1c0c", "max": 1, "min": 0, "orientation": "horizontal", "style": "IPY_MODEL_4c31add106194a728e308ed486fc2e54", "value": 1 } }, "c13a0581f0ff46c4a399627cd8aa1c0c": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": "20px" } }, "c28bf5f9ac624739a48d62510d3bb05d": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "DescriptionStyleModel", "state": { "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "DescriptionStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "StyleView", "description_width": "" } } } } }, "nbformat": 4, "nbformat_minor": 0 }