An in-depth guide to mastering NumPy, covering fundamental to advanced array operations for data science and numerical computing.
- Array Basics
Introduction to NumPy arrays - Arithmetic Operations
Arithmetic operations between (array & scalar) or (array & array) - Comparative Operations
Comparative operations between (array & scalar) or (array & array) - Index & Slice
Basic and advanced indexing and slicing arrays including Mask & Filters - Axes
Understanding use of axes in multi-dimensional arrays combined with methods [the hardest part in NumPy for newbies in my opinion] - Array Manipulations
Techniques for updating values, appending, inserting, reshaping, concatenating, ... - NdArray properties & methods
Comprehensive overview of properties and methods associated with NumPy arrays. - Array Creation
Various methods to create NumPy arrays (e.g.,numpy.array
,numpy.zeros
, etc.). - Mathematics
Mathematical functions and operations available in NumPy - Statistics
Statistical functions for data analysis (mean, median, variance, etc.). - Sort, Search & Count
Methods for sorting, searching, and counting elements in arrays. - Logic
Logical operations and boolean indexing with NumPy arrays. - Set
Set operations for array elements (union, intersection, difference). - Linear Algebra
Fundamental linear algebra operations using NumPy (matrix multiplication, determinants). - Structured Array
Creating and manipulating structured arrays with custom data types. - Input/Output
Techniques for reading from and writing to files using NumPy. - Random Generator
Generating random numbers and distributions with NumPy's random module. - Fourier Transform
Understanding and applying Fourier transforms in NumPy. - Efficient Computing
Strategies for optimizing performance and memory usage in NumPy operations. - Miscellaneous
Additional topics and advanced features in NumPy. - Looking Ahead
Introduction to Pandas for data manipulation and Matplotlib for data visualization.
- 👨💻 Programming Fundamentals
- Proficiency in Python (data types, control structures, functions, classes, etc.).
- My Python Workshop: github.com/mr-pylin/python-workshop
- Proficiency in Python (data types, control structures, functions, classes, etc.).
- 🔣 Mathematics for Machine Learning
- 🔲 Linear Algebra: Vectors, matrices, matrix operations.
- Linear Algebra Review and Reference written by Zico Kolter.
- Notes on Linear Algebra written by Peter J. Cameron.
- MATH 233 - Linear Algebra I Lecture Notes written by Cesar O. Aguilar.
- 🎲 Probability & Statistics: Probability distributions, mean/variance, etc.
- 🔲 Linear Algebra: Vectors, matrices, matrix operations.
This project requires Python v3.10 or higher. It was developed and tested using Python v3.12.8. If you encounter issues running the specified version of dependencies, consider using this version of Python.
Installing matplotlib
and pandas
is OPTIONAL. They are used exclusively in the Looking Ahead Notebook to show an application of using them.
Use Poetry for dependency management. It handles dependencies, virtual environments, and locking versions more efficiently than pip. To install dependencies using Poetry:
-
Option 1 [Recommended]: Install exact dependency versions specified in poetry.lock for consistent environments:
poetry install
-
Option 2: Install the latest compatible dependency versions from pyproject.toml and regenerate the poetry.lock file:
poetry install --no-root
Install all dependencies listed in requirements.txt using pip:
pip install -r requirements.txt
If you encounter connection issues during installation, you can try extending the timeout and increasing the number of retries with the following:
-
For Poetry: Use the following command to set the retries and timeout directly in the terminal before running the install:
-
Windows:
-
PowerShell:
$env:POETRY_HTTP_TIMEOUT=300 $env:POETRY_HTTP_RETRIES=10
-
Command Prompt:
set POETRY_HTTP_TIMEOUT=300 set POETRY_HTTP_RETRIES=10
-
-
Linux/macOS:
-
Terminal:
export POETRY_HTTP_TIMEOUT=300 export POETRY_HTTP_RETRIES=10
-
-
-
For Pip: Use the
--retries
and--timeout
flags directly in your pip command:pip install -r requirements.txt --retries 10 --timeout 300
- Open the root folder with VS Code (
Ctrl/Cmd + K
followed byCtrl/Cmd + O
). - Open
.ipynb
files using the Jupyter extension integrated with VS Code. - Select the correct Python kernel and virtual environment where the dependencies were installed.
- Allow VS Code to install any recommended dependencies for working with Jupyter Notebooks.
✍️ Notes:
- It is highly recommended to stick with the exact dependency versions specified in poetry.lock or requirements.txt rather than using the latest package versions. The repository has been tested on these versions to ensure compatibility and stability.
- This repository is actively maintained, and dependencies are updated regularly to the latest stable versions.
- The table of contents embedded in the notebooks may not function correctly on GitHub.
- For an improved experience, open the notebooks locally or view them via nbviewer.
- Official Website:
- The official website for NumPy, providing information, tutorials, and resources for the NumPy library
- Official site: numpy.org
- Documentation
- Comprehensive guide and reference for all functionalities and features of the NumPy library
- Doc: numpy.org/doc
- Source Code
- Over 1500 contributors are currently working on NumPy.
- Link: github.com/numpy/numpy
- Pandas
- A powerful, open-source data analysis and manipulation library built on top of NumPy for Python
- Official site: pandas.pydata.org
- My Pandas Workshop: Coming Soon
- Data Visualization
- A comprehensive collection of Python libraries for creating static, animated, and interactive visualizations: Matplotlib, Seaborn, and Plotly.
- Official sites: matplotlib.org | seaborn.pydata.org | plotly.com
- My MatPlotLib Workshop: github.com/mr-pylin/data-visualization-workshop
- PyTorch
- An open-source machine learning library for Python developed by Meta AI, used for applications such as deep learning and neural networks.
- Official site: pytorch.org
- My PyTorch Workshop: github.com/mr-pylin/pytorch-workshop
Any mistakes, suggestions, or contributions? Feel free to reach out to me at:
I look forward to connecting with you! 🏃♂️
This project is licensed under the Apache License 2.0.
You are free to use, modify, and distribute this code, but you must include copies of both the LICENSE and NOTICE files in any distribution of your work.