Sometimes we need to extract a part of a series and for that we perform ______ operation.
Sometimes we need to extract a part of a series and for that we perform ______ operation.
Solution
✅ Correct Option: 3
Slicing extracts a part of a series (for example, a pandas Series) by giving a range of positions or labels, such as s[1:4]. It returns a new series containing only those elements.
Option 2: deletion removes elements from the series, but it does not extract a part of it.
Option 4: subtraction is an arithmetic operation between two series (element by element), not a way to select a part.
Slicing a Series by position excludes the end index (s[1:4] gives positions 1, 2, 3), but slicing by label (s['a':'c']) includes the end label.
Related questions:
2025: 20 May Shift 1
2025: 13 May Shift 2