Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'X': range(4), 'Y': range(2, 6)})
df
df.transform(lambda x: x + 1)
Even though the resulting DataFrame must have the same length as the input DataFrame,
it is possible to provide several input functions:
s = pd.Series(range(4))
s
s.transform([np.sqrt, np.exp])