Bit by Bit
← All courses
Data Science · Intermediate

NumPy and Pandas

The two Python libraries behind almost all data science and machine learning. Do maths on whole tables at once, pick out exactly the rows you need, and summarise a dataset in one line.

4 lessons30 minutesFree
Start this course →

Lessons

  1. 1Arrays: maths on everything at onceDo arithmetic on a whole collection of numbers without a loop.7 min
  2. 2Picking out what you needSelect items by position and by condition.7 min
  3. 3Tables with pandasLoad a table, look at it, and summarise its columns.8 min
  4. 4Filter, group and cleanAnswer real questions about a table in one or two lines.8 min

What you will learn

Terms explained in this course

library
A collection of ready-made code that you load into your program with import, so you do not have to write everything yourself.
numpy
The standard Python library for fast maths on large collections of numbers. Short for Numerical Python.
array
NumPy's main object: a grid of numbers of the same type, such as a row of prices or a table of pixels.
element-wise operation
An operation applied to every item of an array at once, such as adding 1 to every number.
vectorisation
Writing a calculation as one operation on a whole array instead of a Python loop over its items. It is much faster.
shape
The size of an array in each direction, such as (3, 4) for 3 rows and 4 columns.
index
The position of an item in a list or array. Python starts counting at 0.
slicing
Taking a section of a list or array by giving a start and an end position, such as a[2:5].
boolean mask
An array of True and False values used to pick out only the items where the value is True.
pandas
The standard Python library for working with tables of data, with named columns and mixed types.
dataframe
A pandas table: rows of examples and named columns of values, like a spreadsheet inside Python.
series
A single column of a pandas DataFrame.
groupby
Splitting a table into groups that share a value, such as a city, then summarising each group.