Complete the code to replace all occurrences of 0 with 100 in the DataFrame column 'score'.
df['score'] = df['score'].[1](0, 100)
The replace() method is used to substitute values in a pandas Series or DataFrame.
Complete the code to replace the string 'low' with 'L' in the 'level' column of the DataFrame.
df['level'] = df['level'].[1]('low', 'L')
The replace() method works for string substitutions in pandas columns.
Fix the error in the code to replace 1 with 10 in the 'count' column.
df['count'] = df['count'].[1](1, 10)
The correct pandas method to replace values is replace(). Other options cause errors.
Fill both blanks to create a dictionary that replaces 'A' with 'Alpha' in the 'grade' column.
df['grade'] = df['grade'].replace([1]: [2])
Use a dictionary inside replace() to map old values to new ones. The keys are old values, the values are new.
Fill all three blanks to replace 0 with 'Zero' and 1 with 'One' in the 'number' column using a dictionary.
df['number'] = df['number'].replace([1]: [2], [3]: 'One'})
Use a dictionary with keys as original values and values as replacements. Here, 0 maps to 'Zero', 1 maps to 'One'.