{"id":13935610,"url":"https://github.com/koaning/drawdata","last_synced_at":"2026-01-07T21:17:43.014Z","repository":{"id":50363271,"uuid":"354640201","full_name":"koaning/drawdata","owner":"koaning","description":"Draw datasets from within Python notebooks.","archived":false,"fork":false,"pushed_at":"2025-04-08T09:55:31.000Z","size":5062,"stargazers_count":1318,"open_issues_count":9,"forks_count":119,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-04-13T15:07:06.044Z","etag":null,"topics":["data","drawdata","jupyter"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koaning.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-04T20:28:10.000Z","updated_at":"2025-04-12T00:05:28.000Z","dependencies_parsed_at":"2024-05-30T10:48:41.280Z","dependency_job_id":"6a315972-5502-45d6-86fb-3cb964c16be6","html_url":"https://github.com/koaning/drawdata","commit_stats":{"total_commits":48,"total_committers":3,"mean_commits":16.0,"dds":"0.10416666666666663","last_synced_commit":"289d960462756064bf503dfe47d9b5b86e9effc1"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koaning%2Fdrawdata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koaning%2Fdrawdata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koaning%2Fdrawdata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koaning%2Fdrawdata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koaning","download_url":"https://codeload.github.com/koaning/drawdata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248732484,"owners_count":21152852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","drawdata","jupyter"],"created_at":"2024-08-07T23:01:55.790Z","updated_at":"2026-01-07T21:17:43.007Z","avatar_url":"https://github.com/koaning.png","language":"JavaScript","funding_links":[],"categories":["Python","JavaScript","其他_机器学习与深度学习","13. Developer Tools \u0026 Integrations"],"sub_categories":[],"readme":"### drawdata \n\n\u003e \"Just draw some data and get on with your day.\"\n\nThis small Python library contains Jupyter widgets that allow you to draw a dataset in a Jupyter\nnotebook. This should be very useful when teaching machine learning algorithms.\n\n![CleanShot 2025-05-08 at 17 27 36](https://github.com/user-attachments/assets/ae87e26e-a720-494f-9fd2-ec0374a9f8f3)\n\nThe project uses [anywidget](https://anywidget.dev/) under the hood so our tools should work in Jupyter, VSCode and Colab. That also means that you get a proper widget that can interact with [ipywidgets](https://ipywidgets.readthedocs.io/en/stable/) natively. [Here](https://www.youtube.com/watch?v=STPv0jSAQEk) is an example where updating a drawing triggers a new scikit-learn model to train ([code](https://github.com/probabl-ai/youtube-appendix/blob/main/04-drawing-data/notebook.ipynb)).\n\nYou can really get creative with this in a notebook, so feel free to give it a spin!\n\n#### Installation \n\nInstallation occurs via pip. \n\n```\npython -m pip install drawdata\n```\n\nTo read the data, `polars` is useful, but this library also suppots `pandas`:\n\n```\npython -m pip install pandas polars\n```\n\n#### Usage: `ScatterWidget`\n\nYou can load the scatter widget to start drawing immediately. \n\n```python\nfrom drawdata import ScatterWidget\n\nwidget = ScatterWidget()\nwidget\n```\n\nIf you want to use the dataset that you've just drawn you can do so via: \n\n```python\n# Get the drawn data as a list of dictionaries\nwidget.data\n\n# Get the drawn data as a dataframe\nwidget.data_as_pandas\nwidget.data_as_polars\n```\n\nIf you're eager to do scikit-learn stuff with your drawn data you may appreciate this property instead:\n\n```\nX, y = widget.data_as_X_y\n```\n\nThe assumption for this property is that if you've used multiple colors that you're interested in doing classification and if you've only drawn one color you're interested in regression. In the case of regression `y` will refer to the y-axis.\n\n#### Usage: `BarWidget`\n\n```python \nfrom drawdata import BarWidget\n\nwidget = BarWidget(collection_names=[\"usage\", \"sunshine\"], n_bins=24)\nwidget\n```\n\n![CleanShot_2024-12-01_at_21 19 19](https://github.com/user-attachments/assets/16c936c8-d310-4fa1-9057-6fb870d43db8)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoaning%2Fdrawdata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoaning%2Fdrawdata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoaning%2Fdrawdata/lists"}