← Back to NumPy Course | Chapter 1: Getting Started | Lesson 1 of 7

What is NumPy

NumPy is a toolbox that lets Python handle big tables of numbers quickly, the way a spreadsheet does, but from code.

In this page:

  1. What is NumPy

What is NumPy

NumPy (Numerical Python) is the foundational library for numerical computing in Python. It provides the ndarray, a fast multi-dimensional array, plus hundreds of functions that operate on whole arrays at once.

Libraries such as Pandas, SciPy, scikit-learn and Matplotlib are all built on top of it.

Note: NumPy's core is written in C, which is why array operations run at near-C speed while you write friendly Python.

Example: What is NumPy

python
import numpy as np

a = np.array([10, 20, 30, 40])
print("Array:", a)
print("Type:", type(a))
print("Doubled:", a * 2)

# Output:
# Array: [10 20 30 40]
# Type: <class 'numpy.ndarray'>
# Doubled: [20 40 60 80]
Related Topics
Common Mistakes
  1. Thinking NumPy is a separate language instead of a Python library
  2. Forgetting that NumPy arrays hold one data type, unlike Python lists
  3. Looping over arrays element by element instead of using vectorized operations
Chapter Summary
  • NumPy is Python's core library for numerical computing
  • Its central object is the ndarray
  • It operates on whole arrays at once (vectorization)
  • Pandas, SciPy and scikit-learn build on it
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.