Answers for "how to do element wise multiplication in python"

1

python element wise multiplication list

# element-wise multiplication of x & y
>>>x = [1,2,3,4]
>>>y = [2,3,4,5]
>>>[a*b for a,b in zip(x,y)]
[2, 6, 12, 20]
Posted by: Guest on June-05-2020
0

how to xor two element in python

>>> from functools import reduce
>>> from operator import xor
>>> bits = ('0', '1', '0', '1', '0', '1', '0')
>>> reduce(xor, map(int, bits))
1
Posted by: Guest on May-03-2020
-2

how to use order in alphabet python

The sorted words are:
Example
Hello
Is
With
an
cased
letters
this
Posted by: Guest on May-26-2020

Code answers related to "how to do element wise multiplication in python"

Python Answers by Framework

Browse Popular Code Answers by Language