Reputation: 2270
I'd like to apply a series to the end of a dataframe, but have the same series in each row of the dataframe. Wondering how I can do this? Example below. Thanks!
Dataframe:
a b
0 2 3
1 6 5
Series:
var1 foo
var2 bar
dtype: object
Output:
a b var1 var2
0 2 3 foo bar
1 6 5 foo bar
Upvotes: 3
Views: 109
Reputation: 323226
By using assign
df.assign(**s)
Out[354]:
a b var1 var2
0 2 3 foo bar
1 6 5 foo bar
Upvotes: 2