pradeepsf729 / pandas_101

Pandas questions with solutions
1 stars 0 forks source link

.loc - 10 Qs #2

Closed sandeepny441 closed 11 months ago

sandeepny441 commented 1 year ago
pradeepsf729 commented 1 year ago

Fixed in https://github.com/pradeepsf729/pandas_101/pull/3

sandeepny441 commented 1 year ago

--------------------------------------LOC

LOC is Label Based Indexing so 1:3 means 1, 2, 3 - INCLUSIVE.

Python is Position based indexing, so 1:3 means 1, 2 -- EXCLUSIVE. when using label-based indexing with. loc, negative indices don't work as they do in standard Python lists.