Assume that I have a dataframe of two rows and 13 columns. I have used df.itertuples() and formed two lists as an output
for row in test.itertuples(index = False):
a = np.asarray(row)
print(a)
let us assume that the Output of the above loop is
Output : [1,2,3,4,5,6,7,8,9,10,11,12,13]
[14,15,16,17,18,19,20,21,22,23,24,25,26]
I have one more list which is of shape (2,) test_y = [21,24]
I also tried
a = test.values.tolist()
output : array([[1,2,3,4,5,6,7,8,9,10,11,12,13],
[14,15,16,17,18,19,20,21,22,23,24,25,26]])
this forms list of lists and then multiplying test_y to a results in an error
error :operands could not be broadcast together with shapes (2,13) (2,)
The objective is multiply the list [1,2,3....] with 21 and the other with 24. or is there any way which is simpler than this