In this lesson, we dive into list indexing and slicing in Python — two essential skills for accessing and manipulating data. Once you understand how Python indexes lists, you'll be able to pull out exactly the data you need, when you need it.
What we cover in this video:
How Python's zero-based indexing works
Accessing list items by position — including negative indexing to count from the end
Slicing a list using the [start:stop:step] syntax
Updating a value at a specific index
Deleting items from a list using del()
Understanding indexing and slicing isn't just a Python skill — it carries over directly into working with NumPy arrays and Pandas DataFrames, which are the workhorses of data science. Master this now and everything else gets easier.
🗂️ This video is part of a foundational Python for Data Science series, originally recorded for an online data science school and now freely available here.