Indexing is used to access values present in the Dataframe using “loc” and “iloc” functions.In Numpy arrays, we are familiar with the concepts of indexing, slicing, and masking, etc. Similarly, Pandas to supports indexing in their Dataframe. If we are familiar with the indexing in Numpy arrays, the indexing in Pandas will be very easy.
Pandas is Python's most popular library for data science. In this tutorial, we will get ourselves familiar with two of the widely used functions to select and filter data from Pandas dataframes: loc and iloc.
Why iloc and loc are preferred for indexing and slicing in pandas ? It may be confusing at first but trust me , you will understand it :)