{"id":20924480,"url":"https://github.com/ax-va/numpy-pandas-matplotlib-scikit-learn-vanderplas-2023","last_synced_at":"2026-03-16T16:07:08.105Z","repository":{"id":154063237,"uuid":"631607033","full_name":"ax-va/NumPy-Pandas-Matplotlib-Scikit-Learn-VanderPlas-2023","owner":"ax-va","description":"These examples provide an introduction to Data Science and classic Machine Learning using NumPy, pandas, Matplotlib, and scikit-learn. They are taken, with some changes, from the book \"Python Data Science Handbook: Essential Tools for Working with Data\", Second Edition, written by Jake VanderPlas and published by O'Reilly Media in 2023.","archived":false,"fork":false,"pushed_at":"2025-02-25T19:10:40.000Z","size":38606,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T04:54:12.506Z","etag":null,"topics":["ax-va","classic-machine-learning","data-science","machine-learning","matplotlib","numpy","pandas","python","scikit-learn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ax-va.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-04-23T14:59:06.000Z","updated_at":"2025-02-25T19:12:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"e592a7c1-b1a5-4175-a3ab-4208a6799450","html_url":"https://github.com/ax-va/NumPy-Pandas-Matplotlib-Scikit-Learn-VanderPlas-2023","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax-va%2FNumPy-Pandas-Matplotlib-Scikit-Learn-VanderPlas-2023","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax-va%2FNumPy-Pandas-Matplotlib-Scikit-Learn-VanderPlas-2023/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax-va%2FNumPy-Pandas-Matplotlib-Scikit-Learn-VanderPlas-2023/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax-va%2FNumPy-Pandas-Matplotlib-Scikit-Learn-VanderPlas-2023/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ax-va","download_url":"https://codeload.github.com/ax-va/NumPy-Pandas-Matplotlib-Scikit-Learn-VanderPlas-2023/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253981750,"owners_count":21994327,"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":["ax-va","classic-machine-learning","data-science","machine-learning","matplotlib","numpy","pandas","python","scikit-learn"],"created_at":"2024-11-18T20:22:37.898Z","updated_at":"2026-03-16T16:07:08.086Z","avatar_url":"https://github.com/ax-va.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learning NumPy, pandas, Matplotlib, and scikit-learn\n\nThese examples provide an introduction to Data Science and classic Machine Learning using **NumPy**, **pandas**, **Matplotlib**, and **scikit-learn**. They are taken, with some changes, from the book *\"Python Data Science Handbook: Essential Tools for Working with Data\"*, Second Edition, written by Jake VanderPlas and published by *O'Reilly Media* in 2023. Some datasets are also taken from the Jake VanderPlas' GitHub repositories https://github.com/jakevdp.\n\nThe content is divided in four separate parts consisting of\n1. numpy\n2. pandas\n3. matplotlib\n4. scikit-learn\n\nexamples, datasets, and figures.\n\nMy environment was Python 3.11 with the following packages and their dependencies (not listed here):\n```\nnumpy==1.25.2\npandas==2.1.0\nmatplotlib==3.8.0\nseaborn==0.12.2\nscikit-learn==1.3.0\nscikit-image==0.21.0\nipython==8.15.0  # optionally\n```\n\n## Original code in Jupyter notebooks by Jake VanderPlas\nhttps://github.com/jakevdp/PythonDataScienceHandbook\n\n## How to run Jupyter QtConsole:\n1) Install **PySide6** and **qtconsole**\n2) Run in the terminal:\n```unix\n$ jupyter qtconsole\n```\n\n## How to run IPython\nRun in the terminal:\n```unix\n$ ipython\n```\n\n## Use `%timeit` command in IPython\n```ipython\nfrom my_module import my_func\n%timeit my_func(1, 2)\n# 45.7 µs ± 1.67 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)\n```\n\n## Get attributes, methods, and functions in IPython\n```ipython\nimport my_module\nmy_module.\u003cTAB\u003e\n```\n\n## Get the source code in IPython\n```ipython\nfrom my_module import my_func\nmy_func??\n# Signature: my_func(x, y)\n# Source:   \n# def my_func(x, y):\n#     \"\"\"\n#     It is my function\n#     \"\"\"\n#     for i in range(1000):\n#         x += 1\n#         y += 1\n#     return x + y\n# File:      ~\u003cpath/to/project\u003e/my_module.py\n# Type:      function\n```\n\n## Get the description in IPython\n```ipython\nmy_func?\n# Signature: my_func(x, y)\n# Docstring: It is my function\n# File:      ~\u003cpath/to/project\u003e/my_module.py\n# Type:      function\n```\n\n## Install line_profiler\n```\npip install line_profiler\n```\n\n## Use line_profiler in IPython\n```ipython\nfrom my_module import my_func\n%load_ext line_profiler\n%lprun -f my_func my_func(1, 2)\n# Line #      Hits         Time  Per Hit   % Time  Line Contents\n# ==============================================================\n#      6                                           def my_func(x, y):\n#      7                                               \"\"\"\n#      8                                               It is my function\n#      9                                               \"\"\"\n#     10      1000    1799776.0   1799.8     31.6      for i in range(1000):\n#     11      1000    1879619.0   1879.6     33.0          x += 1\n#     12      1000    2012540.0   2012.5     35.3          y += 1\n#     13         1       2375.0   2375.0      0.0      return x + y\n```\n\n## Install memory_profiler\n```\npip install memory_profiler\n```\n\n## Use memory_profiler in IPython\n```ipython\nfrom my_module import my_func\n%load_ext memory_profiler\n%memit my_func(1, 2)\n# peak memory: 74.48 MiB, increment: 0.00 MiB\npeak memory: 74.48 MiB, increment: 0.00 MiB\n%mprun -f my_func my_func(1, 2)\n# Line #    Mem usage    Increment  Occurrences   Line Contents\n# =============================================================\n#      6     82.1 MiB     82.1 MiB           1   def my_func(x, y):\n#      7                                             \"\"\"\n#      8                                             It is my function\n#      9                                             \"\"\"\n#     10     82.1 MiB      0.0 MiB        1001       for i in range(1000):\n#     11     82.1 MiB      0.0 MiB        1000           x += 1\n#     12     82.1 MiB      0.0 MiB        1000           y += 1\n#     13     82.1 MiB      0.0 MiB           1       return x + y\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fax-va%2Fnumpy-pandas-matplotlib-scikit-learn-vanderplas-2023","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fax-va%2Fnumpy-pandas-matplotlib-scikit-learn-vanderplas-2023","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fax-va%2Fnumpy-pandas-matplotlib-scikit-learn-vanderplas-2023/lists"}