From the course: pandas Essential Training

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Index

Index - pandas Tutorial

From the course: pandas Essential Training

Start my 1-month free trial

Index

- [Instructor] Indexing. The index object is an immutable array, and indexing allows you to access a row or a column using a label. This is what makes Pandas special, because typically in other programming languages, you cannot access an array using labels. Let's head over to the Jupyter notebook to look at a couple of examples. So let's import Pandas's PD and let's import our CSV dataset into our dataframe oo. To try and understand a little bit more about indexes, let's look at their type, and you can see that an index has its own type and is not series or a dataframe. Let's look at the hundredth element for this dataframe. So oo, index, and 100, and we can see that it's returned the number 100 because that's the hundredth element or the hundredth element in that dataframe. Now indexes are immutable, so that means we cannot change them. So oo.index, and if I try and change 100 to become, say, five, I get an error. I get an "Index does not support mutable operations" error. In this…

Contents