This is a collection of my personal notes and examples while learning NumPy, the fundamental package for scientific computing in Python.
NumPy (Numerical Python) is a powerful library that adds support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays. It's the foundation for data science and machine learning in Python!
These notes cover:
- Basic NumPy array creation and manipulation
- Array types, dimensions, and shapes
- Indexing and slicing operations
- Mathematical operations and statistics
- Broadcasting and vectorized operations
- Boolean arrays and conditional operations
- Linear algebra operations
- Utility functions (random number generation, reshaping, etc.)
These notes are meant to be a quick reference guide. Each section includes code examples that you can run to see NumPy in action. Feel free to clone this repository and experiment with the examples!
# Example: Creating arrays and performing operations
import numpy as np
# Create an array
arr = np.array([1, 2, 3, 4, 5])
# Perform operations
print(arr * 2) # [2 4 6 8 10]
print(arr.mean()) # 3.0To use NumPy, you need to install it first:
pip install numpyor with conda:
conda install numpyFound a mistake or want to add more notes? Feel free to submit a pull request or open an issue!
Here are some additional resources for learning NumPy:
- Official NumPy Documentation
- NumPy Quickstart Tutorial
- Python Data Science Handbook
- FreeCodeCamp's Video Tutorial
Feel free to use these notes for your personal learning