when I use this syntax it creates a series rather than adding a column to my new dataframe (sum). Please help.
My code:
sum = data[\'variance\'] = d
You could also use the .add() function:
df.loc[:,'variance'] = df.loc[:,'budget'].add(df.loc[:,'actual'])