How come the result of the .iloc is not a list?


#1

Question

How come the result of the .iloc is not a list? Why does it show a series?

Answer

When using iloc in Pandas, it will return a specified row, but in the form of a Series.

The left column in the result is composed of indexes which are the column names from the dataframe. And the right column is composed of the values for each column in the row of data.

This is a helpful feature in Pandas because it displays all the information about the columns and values of a row in a clear way.