Answers for "how to update a column in python with new value"

0

dataframe change column value

df["column1"].replace({"a": "x", "b": "y"}, inplace=True)
Posted by: Guest on July-05-2021
0

updating column values

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

df['col'] = df['col'].map(mapping_dict)
print(my_series)
Posted by: Guest on July-29-2021

Code answers related to "how to update a column in python with new value"

Python Answers by Framework

Browse Popular Code Answers by Language