I have a Pandas Dataframe and want to add the data from a dictionary uniformly to all rows in my dataframe. Currently I loop over the dictionary and set the value to my new columns. Is there a more efficient way to do this?
# coding: utf-8
import pandas as pd
df = pd.DataFrame({'age' : [1, 2, 3],'name' : ['Foo', 'Bar', 'Barbie']})
d = {"blah":42,"blah-blah":"bar"}
for k,v in d.items():
df[k] = v
df