Q:

Manually calculating predictions using separate dataframes

I developed a model and have a dataframe containing the features used and their coefficient:
feature    coefficient
intercept  2.5
a          0.5
b          0.8
c          1.7

I also have a dataframe containing completely new data:
a  b  c
1  0  2
0  1  3

I want to create a prediction for each observation using the formula:
intercept + a_coef*a_value + b_coef*b_value + c_coef*c_value

But I'm not sure how to manipulate both dataframes in such a way.

A:

You can assign intercept in new dataframe, then do dot
s=df.set_index('feature')['coefficient']
newdf.assign(intercept=1).dot(s)
Out[249]: 
0    6.4
1    8.4
dtype: float64

