Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Introduction to NumPy | Python Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. Python Fundamentals

Lesson 37 of 55

·Python

Introduction to NumPy

20 minutes

Course progress67%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • `np.array` creates an N‑dimensional array.
  • Vectorized operations (`+`, `*`, `np.sin`, etc.) operate element‑wise.
  • Common functions: `.mean()`, `.sum()`, `.reshape()`, `np.arange`.
  • Arrays are homogeneous (all elements share the same dtype).

Introduction to NumPy

NumPy provides high‑performance N‑dimensional array objects and a vast collection of mathematical functions. It’s the foundation of most Python scientific libraries.

import numpy as np

a = np.array([1, 2, 3])
print('Array:', a)
print('Mean:', a.mean())

# 2‑D array (matrix)
b = np.arange(6).reshape(2, 3)
print('2×3 matrix:
', b)

Operations on NumPy arrays are vectorized, meaning they execute C‑level loops under the hood—much faster than native Python loops.

Make it stickPractice what you've learned1 quiz · 5 practical tests · Optional activities from Python FundamentalsBrowse activities
Previous lessonPackaging and DistributionContinue to lesson 38Introduction to PandasBack to Python Fundamentals curriculum