{"id":17110819,"url":"https://github.com/gahjelle/numpy-introduction","last_synced_at":"2025-11-05T09:02:32.955Z","repository":{"id":188227110,"uuid":"678332479","full_name":"gahjelle/numpy-introduction","owner":"gahjelle","description":"Introductory tutorial to NumPy","archived":false,"fork":false,"pushed_at":"2023-08-14T11:15:51.000Z","size":33,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-14T12:58:47.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/gahjelle.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}},"created_at":"2023-08-14T10:00:25.000Z","updated_at":"2024-10-30T20:46:43.000Z","dependencies_parsed_at":"2023-08-14T11:35:40.114Z","dependency_job_id":null,"html_url":"https://github.com/gahjelle/numpy-introduction","commit_stats":null,"previous_names":["gahjelle/numpy-introduction"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gahjelle/numpy-introduction","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gahjelle%2Fnumpy-introduction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gahjelle%2Fnumpy-introduction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gahjelle%2Fnumpy-introduction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gahjelle%2Fnumpy-introduction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gahjelle","download_url":"https://codeload.github.com/gahjelle/numpy-introduction/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gahjelle%2Fnumpy-introduction/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266878574,"owners_count":23999620,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-14T16:46:39.352Z","updated_at":"2025-11-05T09:02:27.927Z","avatar_url":"https://github.com/gahjelle.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction to NumPy\n\nThis repository contains material for the tutorial I presented at the [EuroSciPy 2023](https://www.euroscipy.org/2023/) conference in Basel.\n\n## Topics\n\nThe tutorial covers the following topics:\n\n- The NumPy array\n- Generating random numbers with NumPy\n- Vectorized operations\n- Linear algebra\n- Broadcasting\n\n## Description\n\nNumPy is one of the foundational packages for doing data science with Python. It enables numerical computing by providing powerful N-dimensional arrays and a suite of numerical computing tools. In this tutorial, you'll be introduced to NumPy arrays and learn how to create and manipulate them. Then, you'll see some of the tools that NumPy provides, including random number generators and linear algebra routines.\n\nThis tutorial will be an introduction to numerical computing with Python and the NumPy library. It's intended for people who are new to NumPy and Python's scientific stack, or those who need a refresher. \n\nIn this tutorial, you'll learn about different ways to create NumPy arrays. You'll see how you can pull out individual elements or sub-arrays from them. Even more importantly, you'll learn about broadcasting and vectorization. These are NumPy's superpowers that help you write code that's both readable and fast.\n\nNumPy's arrays are the foundational building blocks. However, you'll also dip your toes into some of the numerical computing tools that are part of the library. In particular, you'll learn the best practices for working with random numbers in NumPy. Furthermore, you'll see how to perform linear algebra operations like matrix addition, multiplication, and inversion.\n\n## Preparations\n\nYou should create a virtual environment and install numpy and other necessary dependencies.\n\n\u003e **Note:** Demonstrations were done on Linux Ubuntu with Python 3.11.4 and packages and versions specified in [`requirements.txt`](requirements.txt).\n\n### Conda/Anaconda\n\nIf you have installed the full **Anaconda** distribution, you already have all the necessary dependencies on your system.\n\nIf you're running **Miniconda** or want to set up a separate environment for this tutorial, you can use `conda` to do so:\n\n```console\n$ conda env create -n euroscipy-numpy -f environment.yml\n$ conda activate euroscipy-numpy\n```\n\nRemember to activate your Conda environment.\n\n### Pip\n\nIf you're using a plain Python distribution, then you can use `venv` to create a [virtual environment](https://realpython.com/python-virtual-environments-a-primer/):\n\n```console\n$ python -m venv venv\n$ source venv/bin/activate\n(venv) $ python -m pip install -r requirements.txt\n```\n\nOn Windows, you don't need `source` when activating your virtual environment. You can type `venv\\Scripts\\activate` instead.\n\n## Exercises\n\nYou'll find the exercises in the [`exercises/`](exercises/) folder. You can open the `.py` files in your favorite editor. It may be helpful if your editor supports cells in script files. For example, [VS Code](https://code.visualstudio.com/) and [Spyder](https://www.spyder-ide.org/) support these cells and make it more convenient to run your solutions.\n\nIf you prefer to solve the exercises in Jupyter, you can convert the exercise files to notebooks using [`jupytext`](https://jupytext.readthedocs.io/):\n\n```console\n(venv) $ cd exercises/\n(venv) $ jupytext --sync *.py\n```\n\n`jupytext` will convert all exercise files to notebooks that you can open in Jupyter Lab, or any other compatible notebook environment.\n\nYou can find solutions to all exercises in the [`solutions`](solutions/) folder.\n\n## Demonstrations\n\nThe workshop mostly consists of live code demonstrations. You can find simple notes from the demos in the file [`numpy_introduction.py`](numpy_introduction.py). Use `jupytext` to convert the notes to a Jupyter Notebook if you prefer.\n\n---\n\nDemonstration code, exercises, and solutions are licensed under an [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgahjelle%2Fnumpy-introduction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgahjelle%2Fnumpy-introduction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgahjelle%2Fnumpy-introduction/lists"}