Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python multiply all elements in array by constant

import numpy as np
array1 = np.array([1, 2, 3])
array2 = np.array([[1, 2], [3, 4]])
n = 5
np.multiply(array1,n)
np.multiply(array2,n)
Comment

PREVIOUS NEXT
Code Example
Python :: get date and time python 
Python :: key item loop list python 
Python :: sns save chart 
Python :: sacar la posicion en una lista python 
Python :: matplotlib bold 
Python :: random permutation python 
Python :: scikit learn linear regression 
Python :: how to make a pygame window 
Python :: python teilen ohne rest 
Python :: py-trello add card 
Python :: python date from yy/mm/dd to yy-mm-dd 
Python :: yum install python3 
Python :: browser refresh selenium python 
Python :: python random phone number 
Python :: create folder python 
Python :: mean class accuracy sklearn 
Python :: how to say hello world 
Python :: Removing all non-numeric characters from string in Python 
Python :: sort list of string datetimes python 
Python :: remove duplicates without changing order python 
Python :: How to find majority element in a sequence of values using Boyer-Moore vote algorithm? 
Python :: matplotlib add legend axis x 
Python :: python cube root 
Python :: python dict order a dict by key 
Python :: remove duplicate row in df 
Python :: os file exists 
Python :: python check if number is float or int 
Python :: python reduce function to sum array 
Python :: select text in a div selenium python 
Python :: pyqt5 math 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =