Can't understand the use of index

could not understand the use of "index " here in first guided project please help

for row in data:
    index += 1

The dataset contained a column with a bunch of information about each helicopter escape. This column is lengthy, messy and it doesn’t really add anything from a data perspective.

The loop you’ve attached removes the last column.

This line:


takes all of the information except for whatever was in the last column and stores it back into the dataset in the same row where it was originally.

The index variable allows you to iterate over the dataset to replace each row.

Hope this helps!

1 Like