Answers for "df = df.apply(lambda x: np.square(x) if x.name in [ 'a', 'e', 'g'] else x, axis=1)"

0

df = df.apply(lambda x: np.square(x) if x.name in [ 'a', 'e', 'g'] else x, axis=1)

import numpy as np  # optional
import pandas as pd
print(pd.__version__)
print(pd.show_versions(as_json=True))
Posted by: Guest on February-07-2021

Python Answers by Framework

Browse Popular Code Answers by Language