Skip to content Skip to sidebar Skip to footer

Multiply List Of Ndarrays By List

I want to multiply a list of numbers, by a ndarray, that is, each number in the list multiply by the first ndarray. This is the list: list1 = [840,845,897] This is the list of nd

Solution 1:

You can loop over the array like so:

nd = np.array( ... )
for i, x in enumerate(list1):
    for y in nd[i]:
        for j in range(len(y)):
            y[j] *= x
print(nd)

Post a Comment for "Multiply List Of Ndarrays By List"