How it works...

Step 2 first retrieves the column index through the columns attribute. Indexes have a get_loc method, which accepts an index label and returns its integer location. We find both the start and end integer locations for the columns that we wish to slice. We add one because slicing with .iloc is exclusive of the last item. Step 3 uses slice notation with the rows and columns.

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

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