Skip to main content
Course/Module 2/Topic 1 of 4Beginner

NumPy Fundamentals

Master the fundamental package for scientific computing in Python

45 minBy Priygop TeamLast updated: Feb 2026

What is NumPy?

NumPy (Numerical Python) is the fundamental package for scientific computing in Python. It provides support for large, multi-dimensional arrays and matrices, along with a collection of high-level mathematical functions to operate on these arrays.

Key Features

  • N-dimensional Arrays: efficient array operations
  • Mathematical Functions: Built-in mathematical operations
  • Linear Algebra: Matrix operations and decompositions
  • Random Number Generation: Various probability distributions

Creating NumPy Arrays

Example
import numpy as np

# Create arrays
arr1 = np.array([1, 2, 3, 4, 5])
arr2 = np.zeros((3, 4))  # 3x4 array of zeros
arr3 = np.ones((2, 3))   # 2x3 array of ones
arr4 = np.arange(0, 10, 2)  # Array from 0 to 10, step 2
arr5 = np.linspace(0, 1, 5)  # 5 evenly spaced values from 0 to 1

# Random arrays
random_arr = np.random.rand(3, 3)  # 3x3 random array
normal_arr = np.random.normal(0, 1, 100)  # 100 normal distributed values

Array Operations

Example
# Basic operations
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])

print(a + b)  # [5 7 9]
print(a * b)  # [4 10 18]
print(a ** 2)  # [1 4 9]

# Statistical operations
data = np.array([1, 2, 3, 4, 5])
print(np.mean(data))    # 3.0
print(np.std(data))     # 1.414...
print(np.median(data))  # 3.0
print(np.max(data))     # 5
print(np.min(data))     # 1

📚 Additional Resources

Recommended Reading

  • Python for Data Analysis by Wes McKinney
  • Python Data Science Handbook by Jake VanderPlas
  • NumPy and Pandas Official Documentation

Online Resources

  • NumPy Tutorial
  • Pandas Getting Started Guide
  • Matplotlib Tutorial
Chat on WhatsApp
Priygop - Leading Professional Development Platform | Expert Courses & Interview Prep