Select the first row only
Here, we are selecting the first rows using iloc, Dataframe.iloc[] method is used when the index label of a data frame is something other than numeric series.
Python3
# select first row # from the dataframe df.iloc[ 0 ] |
Output:
Select a row of series or dataframe by given integer index
The Dataframe.iloc[] is used to select a row of Series/Dataframe by a given integer index in Python.