我是熊猫的新手,试图弄清楚如何同时向熊猫添加多个列。任何帮助都是感激的。理想情况下,我希望在一个步骤中做到这一点,而不是重复多个步骤……
import pandas as pd
df = {'col_1': [0, 1, 2, 3],
'col_2': [4, 5, 6, 7]}
df = pd.DataFrame(df)
df[[ 'column_new_1', 'column_new_2','column_new_3']] = [np.nan, 'dogs',3] #thought this would work here...