Match the LIST-I with LIST-II
LIST-I LIST-II A. df.loc['Science'] I. Merging B. df.loc['Maths']>90 II. Slicing C. df.loc['Maths':'Science'] III. Boolean Indexing D. df1=df1.append(df2) IV. Label based indexing
Match the LIST-I with LIST-II
| LIST-I | LIST-II | ||
|---|---|---|---|
| A. | df.loc['Science'] | I. | Merging |
| B. | df.loc['Maths']>90 | II. | Slicing |
| C. | df.loc['Maths':'Science'] | III. | Boolean Indexing |
| D. | df1=df1.append(df2) | IV. | Label based indexing |
Solution
✅ Correct Option: 2
| List I | List II |
|---|---|
| (A) df.loc['Science'] | (IV) Label based indexing |
| (B) df.loc['Maths']>90 | (III) Boolean Indexing |
| (C) df.loc['Maths':'Science'] | (II) Slicing |
| (D) df1=df1.append(df2) | (I) Merging |
A single label inside loc picks out one row by its name, so it is label based indexing.
A comparison such as >90 returns True/False values, which is what Boolean indexing uses.
With loc, a range like 'Maths':'Science' includes both end labels, unlike normal Python slicing.