The Python NumPy Quick Guide is a quick reference guide and a practical mini-course for anyone wishing to master the NumPy library efficiently.
Here you will find:
- 🧠 Fundamental Concepts: Clear and direct explanations.
- 🧪 Practical Examples: Interactive Jupyter Notebooks.
- 🚀 Focus on Performance: Learn to use the power of vector computing.
The Python Fundamentals part has already been completed! ✅ If you need to review the language basics before diving into NumPy, check out our previous repository:
This guide wasn't created out of thin air! All practical and theoretical content presented here is strongly inspired and grounded in the "bible" of modern data analysis:
📖 "Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython"
— by Wes McKinney (Creator of Pandas)
What's the connection? The book details how the Data Science ecosystem in Python works. It explains that to master advanced tools like Pandas and Machine Learning, you first need to understand the foundation of everything: NumPy.
In this repository, we distill the essence of NumPy presented in the work, transforming theory into practical, direct examples ready for use in your daily life as a developer.
The Array is the heart of NumPy. ❤️
Imagine a shelf full of boxes, where each box holds a number.
- This shelf is the Array.
- All boxes must hold the same type of thing (no mixing bananas with screws!).
- You find any box quickly using its address (the index).
Arrays are not just straight lines. They can have various shapes (dimensions):
- 1D (Vector): A simple line of numbers.
- 2D (Matrix): A table, like an Excel spreadsheet.
- 3D (Tensor): A cube of numbers (or several stacked spreadsheets).
- nD: And so on... as far as your imagination (and RAM) can handle!
What can you do with them? Everything! Sum, multiply, take the average, standard deviation, reshape (turn a line into a square), slice specific pieces... all at once, without boring loops. It's mathematics on an industrial scale! 🏭
NumPy (Numerical Python) is the base of scientific computing in Python. Below is a comparison showing why it is superior to standard Python lists for data analysis:
| Feature | NumPy Array ⚡ | Python List 🐍 | Details |
|---|---|---|---|
| Performance | 🚀 Extremely Fast | 🐢 Slow | Implemented in C, optimized for vectorized calculations. |
| Memory | 💾 Compact | 🎈 Heavy | Uses contiguous memory blocks; efficient storage. |
| Typing | 🔒 Static (Homogeneous) | 🔀 Dynamic (Heterogeneous) | All elements must be of the same type. |
| Math Operations | 🧮 Vectorized (Batch) | 🐌 Element-by-element | Apply functions to whole arrays without loops. |
| Broadcasting | 🔄 Supported | ❌ Not supported | Arithmetic between different shapes. |
| Ecosystem | 🌐 Foundation | 📦 Standalone | Base for Pandas, Scikit-Learn, TensorFlow, etc. |
Follow the steps below to set up your environment and start studying:
To ensure compatibility, it is important to use the specified versions.
Step by step:
-
Clone the repository:
git clone https://github.com/Francionlj/python-numpy-quick-guide-.git cd python-numpy-quick-guide- -
Run the setup script (Linux/macOS):
bash venv.sh
This script will check if you have Python 3.13.x installed, create the virtual environment, and install NumPy 2.4.2 and Jupyter.
-
Activate the virtual environment:
source venv/bin/activate
This guide uses Jupyter Notebooks (.ipynb) for an interactive experience.
To open the notebooks:
jupyter notebookThis will open a tab in your browser where you can navigate through the folders and open the .ipynb files.
The content is divided into two main modules to facilitate your learning:
Ideal for those starting now.
📖 Chapter 1: NumPy ndarray (In Progress)
📖 Chapter 2: Pseudo-random number generation (In Creation)
📖 Chapter 3: Universal functions (In Creation)
📖 Chapter 4: Array-oriented programming (In Creation)
📖 Chapter 5: File input and output with arrays (In Creation)
📖 Chapter 6: Linear algebra (In Creation)
📖 Chapter 7: Example and Conclusion (In Creation)
For those who want to master the tool and optimize performance.
📖 Chapter A-1: Internal organization of the ndarray object (Coming Soon)
📖 Chapter A-2: Advanced array manipulation (Coming Soon)
📖 Chapter A-3: Broadcasting (Coming Soon)
📖 Chapter A-4: Advanced use of ufuncs (Coming Soon)
📖 Chapter A-5: Structured and record arrays (Coming Soon)
📖 Chapter A-6: More details on sorting (Coming Soon)
📖 Chapter A-7: Creating fast functions in NumPy with Numba (Coming Soon)
📖 Chapter A-8: Advanced input and output operations with arrays (Coming Soon)
📖 Chapter A-9: Performance tips (Coming Soon)
This project is distributed under the Python Software Foundation License. Refer to the LICENSE file for more details.

