I have the following line of code in MATLAB which I am trying to convert to Python numpy
:
pred = traindata(:,2:257)*beta;
In Python, I have:
pred = traindata[ : , 1:257]*beta
beta
is a 256 x 1 array.
In MATLAB,
size(pred) = 1389 x 1
But in Python,
pred.shape = (1389L, 256L)
So, I found out that multiplying by the beta
array is producing the difference between the two arrays.
How do I write the original Python line, so that the size of pred
is 1389 x 1, like it is in MATLAB when I multiply by my beta array?