Introduction to Python for Data Science

Updated Jun 2026

Prerequisites

We recommend completing these modules before starting this one.

Integers

An integer is a whole number — no decimal point.

score = 0
age = 25
year = 2026
students = 150

You can do math with integers:

score = 10
score = score + 5
print(score)  # 15

Integers can be negative:

temperature = -12
balance = -500

Floats

A float is a number with a decimal point.

price = 9.99
height = 1.75
percentage = 0.85
temperature = 36.6

Most arithmetic in Python that involves division produces a float:

print(10 / 2)   # 5.0 — float, not 5
print(7 / 2)    # 3.5

You can do all the same math with floats as with integers:

price = 9.99
tax = price * 0.15
total = price + tax
print(total)  # 11.4885

When to use int vs float:

Use integers for things you count — number of students, score, age, year. Use floats for things you measure — price, height, percentage, temperature.

Units in this module

  1. 1. NumPy Arrays
  2. 2. Pandas
  3. 3. Data Cleaning