Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'temp_c': [7.8, 17.2]},
index=['Malaysia', 'Maldives'])
df
Where the value is a callable, evaluated on df:
df.assign(temp_f=lambda x: x.temp_c * 9 / 5 + 32)
Alternatively, the same behavior can be achieved by directly referencing an existing
Series or sequence:
df.assign(temp_f=df['temp_c'] * 9 / 5 + 32)