Ravindra BagaleCourses & study guides मराठी Track your progress

NumPy Tutorial for Beginners: Arrays, Maths and Filtering in Python

Ravindra Bagale's Tip — Chala mitrano

pandas is built on NumPy. Today we take our first steps: arrays, fast maths on whole columns, and filtering with True/False. After this, pandas will feel familiar.

What you will learn in this chapter

  • Why NumPy is faster than lists
  • Create arrays and check shape and dtype
  • Maths on a whole array at once
  • Summary statistics
  • Filtering with boolean masks
  • 2D arrays — rows and columns

Practice data

All names, shops, banks, hospitals and amounts in this chapter are made up for learning. They are not real people or real company numbers.

Concepts in this chapter

  1. P12.1What Is NumPy and Why Use It Instead of Lists
  2. P12.2How to Create NumPy Arrays: array, arange, zeros, linspace
  3. P12.3NumPy Array Maths: Add, Multiply and Compare Whole Arrays
  4. P12.4NumPy Statistics: sum, mean, median, min, max, std
  5. P12.5NumPy Boolean Indexing: Filter Arrays with Conditions
  6. P12.6NumPy 2D Arrays: Rows, Columns and Axis