Informatics Practices
To display first three elements of a Series object S, you may write …………… .
- S[:3]
- S[3]
- S[3rd]
- all of these
Python Pandas
2 Likes
Answer
S[:3]
Reason — The syntax to extract slices from Series object is <Series Object>[start:end:step]
. Therefore, according to this syntax, the correct slice notation to display the first three elements of a Series object S
is S[:3]
.
Answered By
1 Like
Related Questions
To check if the Series object contains NaN values, …………… attribute is displayed.
- hasnans
- nbytes
- ndim
- dtype
To display third element of a Series object S, you will write …………… .
- S[:3]
- S[2]
- S[3]
- S[:2]
To display last five rows of a Series object S, you may write …………… .
- head()
- head(5)
- tail()
- tail(5)
Which of the following statement is wrong ?
- We can't change the index of the series
- We can easily convert the list, tuple, and dictionary into a series
- A series represents a single column in memory
- We can create empty series.