How it works...

The normal behavior of .loc is to make selections of data based on the exact labels passed to it. It raises a KeyError when these labels are not found in the index. However, one special exception to this behavior exists whenever the index is lexicographically sorted, and a slice is passed to it. Selection is now possible between the start and stop labels of the slice, even if they are not exact values of the index.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset