KnowledgeBoat Logo
|
LoginJOIN NOW

Informatics Practices

To display first three elements of a Series object S, you may write …………… .

  1. S[:3]
  2. S[3]
  3. S[3rd]
  4. 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