______________method can also be used to change the data values of a row to a particular value.
______________method can also be used to change the data values of a row to a particular value.
Solution
✅ Correct Option: 3
DataFrame.loc[] selects data by row label (and optionally column label), so assigning to it changes the selected values. For example, df.loc['row1'] = 0 sets every value in the row labelled row1 to 0, and df.loc['row1', 'col1'] = 5 changes a single cell.
Option 1: DataFrame.values is an attribute that returns the data as a NumPy array. It is not the standard way to select a row by label and assign to it.
loc[] uses labels, while iloc[] uses integer positions. Both can be used to assign values.
Related questions:
2026: 21 May Shift 1
2025: 27 May Shift 2
2025: 16 May Shift 1