Doing an expression in Pandas instead of NumPy

Viewed 33

I was actually doing this expression:

<class 'numpy.ndarray'>
np.array(w[0] + w[1]*np.array(X[:,0]) + w[2]*np.array(X[:,1]))

Now I have a Pandas dataframe and I wanna do it the same way but without converting it into a NumPy array, so what is the equivalent of this expression:

np.array(w[0] + w[1]*np.array(X[:,0]) + w[2]*np.array(X[:,1]))

in Pandas?

<class 'pandas.core.frame.DataFrame'>
0 Answers
Related