THE LOC() AND ILOC() METHODS IN PANDAS
If you want to display the contents of a record in a Pandas DataFrame, specify the index of the row in the loc() method. For example, the following code snippet displays the data by feature name in a data frame df:
df.loc[feature_name]
Select the first row of the “height” column in the data frame:
df.loc([0], ['height'])
The following code snippet uses the iloc() function to display the first 8 records of the name column with this code snippet:
df.iloc[0:8]['name']