Top "Elementwise-operations" questions

Comparing two NumPy arrays for equality, element-wise

What is the simplest way to compare two NumPy arrays for equality (where equality is defined as: A = B iff …

python arrays numpy elementwise-operations
How to perform element-wise multiplication of two lists?

I want to perform an element wise multiplication, to multiply two lists together by value in Python, like we can …

python list multiplication elementwise-operations
Element-wise addition of 2 lists?

I have now: list1 = [1, 2, 3] list2 = [4, 5, 6] I wish to have: [1, 2, 3] + + + [4, 5, 6] || || || [5, 7, 9] Simply an element-wise addition of two lists. I can surely iterate …

python list elementwise-operations
How to get element-wise matrix multiplication (Hadamard product) in numpy?

I have two matrices a = np.matrix([[1,2], [3,4]]) b = np.matrix([[5,6], [7,8]]) and I want to get the element-wise product, [[1*5,2*6], [3*7,4*8]], equaling [[5,12], [21,32]] I …

python numpy matrix matrix-multiplication elementwise-operations
How to multiply all integers inside list

Hello so I want to multiply the integers inside a list. For example; l = [1, 2, 3] l = [1*2, 2*2, 3*2] output: l = [2, 4, 6] So I was …

python list multiplication scalar elementwise-operations
Element-wise string concatenation in numpy

Is this a bug? import numpy as np a1=np.array(['a','b']) a2=np.array(['E','F']) In [20]: add(…

python arrays string numpy elementwise-operations
Array elementwise operations

I have two input arrays x and y of the same shape. I need to run each of their elements …

python arrays numpy elementwise-operations
Are there builtin functions for elementwise boolean operators over boolean lists?

For example, if you have n lists of bools of the same length, then elementwise boolean AND should return another …

python list built-in boolean-operations elementwise-operations
How can I sum arrays element-wise in Perl?

I have two arrays: @arr1 = ( 1, 0, 0, 0, 1 ); @arr2 = ( 1, 1, 0, 1, 1 ); I want to sum items of both arrays to get new one like ( 2, 1, 0, 1, 2 ); Can …

arrays perl sum elementwise-operations
elementwise combination of two lists in R

Say I have two lists: list.a <- as.list(c("a", "b", "c")) list.b <- as.…

r elementwise-operations