Change multiple value in one column

HI! try to understand method here. after we changed the value in ‘os’ column, I printed the frequency of ‘os’ column. I still see Mac OS and mac OS, It seems that we did not save the change to laptops file after we mapped. What we need to do here?

mapping_dict = {
    'Android': 'Android',
    'Chrome OS': 'Chrome OS',
    'Linux': 'Linux',
    'Mac OS': 'macOS',
    'No OS': 'No OS',
    'Windows': 'Windows',
    'macOS': 'macOS'


You are not assigning it back to the laptops variable.

laptops['os'] = laptops['os'].map(mapping_dict)

The map method is not executed in place.


This was helpful

But i still don’t understand this expression “s =”. what is the “s.” What “s” function?Is it a variable because i can’t see the value(s) in the note.

“s” is short for Series. laptops['os'] is a column from the laptops DataFrame, therefore it is a Series.

1 Like

Alright. Thanks for the response

1 Like