Informatics Practices

If Ser is a Series type object having 30 values, then how are statements (a), (b) and (c), (d) similar and different ?

(a) print(Ser.head())

(b) print(Ser.head(8))

(c) print(Ser.tail())

(d) print(Ser.tail(11))

Python Pandas

3 Likes

Answer

The statements (a), (b), (c) and (d) are all used to view the values from a pandas Series object Ser. However, they differ in the number of values they display.

(a) print(Ser.head()): This statement will display the first 5 values from the Series Ser.

(b) print(Ser.head(8)): This statement will display the first 8 values from the Series Ser.

(c) print(Ser.tail()): This statement will display the last 5 values from the Series Ser.

(d) print(Ser.tail(11)): This statement will display the last 11 values from the Series Ser.

Answered By

2 Likes


Related Questions