An error confusion


Shouldn’t rows without the header be: data_set[2:]?
like this:Screenshot 2020-12-25 164439
3 here: is the number of the element position not the index number, right?

Hi @Maho,

No, 3 in your second screenshot is exactly the index, not the number of elements. Your first_3 will include the items with the idices 0, 1, and 2 (i.e. up to 3, but 3 not included), while the last_3 will include the indices -3, -2, and -1 (-0 just doesn’t exist in indexing :blush:).

Hence, returning to your header, it will be the item (the row) with the index 0. So, the rows without the header will be rows = data_set[1:].

https://community.dataquest.io/uploads/default/original/2X/e/e5411f6ea7c747e7374a9b21a8cf1216dd59497a.png
but last_3 = row_3[-3:]
-3 is the index number of ‘USD’

Yes, exactly.
-3 is the index of USD, -2 of 2130805, and -1 of 4.5.
When you print these values, they appear exactly in this order: from the value with the index -3 till the value with the index -1 (inclusive).