Skip to content

Francionlj/The_NumPy_Shortcut

Repository files navigation


NumPy Logo

The NumPy Shortcut

Python   Status   Numpy   Project Status


🚫 We are not accepting community contributions at this time.

Attention We love our community and are very grateful for the interest! 💙
However, our maintainers are not accepting external contributions (Pull Requests) at this moment.
This guide was created to help those in need, focusing exclusively on NumPy functions and practices.
Feel free to use, study, and fork! Thank you for understanding! 😊

📚 About this Repository

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.

🐍 Prerequisites: Python Fundamentals

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:

👉 Python Fundamentals Journey


📖 Theoretical Basis and Inspiration

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.


📦 What is an Array?

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).

📐 Dimensions and Powers

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! 🏭


🚀 Why NumPy? (Features & Advantages)

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.

🛠️ How to Use this Guide

Follow the steps below to set up your environment and start studying:

1. Environment Setup

To ensure compatibility, it is important to use the specified versions.

Step by step:

  1. Clone the repository:

    git clone https://github.com/Francionlj/python-numpy-quick-guide-.git
    cd python-numpy-quick-guide-
  2. 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.

  3. Activate the virtual environment:

    source venv/bin/activate

2. Running the Notebooks

This guide uses Jupyter Notebooks (.ipynb) for an interactive experience.

To open the notebooks:

jupyter notebook

This will open a tab in your browser where you can navigate through the folders and open the .ipynb files.


🗂️ Course Structure

The content is divided into two main modules to facilitate your learning:

🟢 Module 1: Basic NumPy (Fundamentals)

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)

🔴 Module 2: Advanced NumPy (Power User)

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)


📜 License

This project is distributed under the Python Software Foundation License. Refer to the LICENSE file for more details.


Made with 💙 by Francionlj

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published