Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python arithmetic operation with list

#If you're going to be doing lots of array operations,
#then you will probably find it useful to install Numpy.
#Then you can use ordinary arithmetic operations element-wise on arrays,
#and there are lots of useful functions for computing with arrays.
>>> import numpy
>>> a = numpy.array([111,222,333])
>>> a * 3
array([333, 666, 999])
>>> a + 7
array([118, 229, 340])
>>> numpy.dot(a, a)
172494
>>> numpy.mean(a), numpy.std(a)
(222.0, 90.631120482977593)
Comment

PREVIOUS NEXT
Code Example
Python :: save impt 
Python :: python random number generator 
Python :: et.dump export file to xml write method 
Python :: programação funcional python - append 
Python :: networkx draw tripartite graph 
Python :: how to catch stop itteration in generator as None 
Python :: select series of columns 
Python :: striding in python 
Python :: Python - Cómo cruda la cuerda 
Python :: 201903100110041 
Python :: how to fetch only the columns from a datframe which has a particular datatype 
Python :: python -c crypt command in python3.3 and above 
Python :: computercraft turtle place block 
Python :: python length checker/fill 
Python :: Issue TypeError: ‘numpy.float64’ object cannot be interpreted as an integer 
Python :: Create tiff stack in python 
Python :: moviepy not able to read the image file format 
Python :: random module randint 
Python :: workbook select sheet python 
Python :: SQLAlchemy Users to JSON code snippet 
Python :: read file python 
Python :: create line in canvas widget object 
Python :: matplotlib set dpi 300 
Python :: how to check the version of ployly 
Python :: Compute Jordan normal form of matrix in Python / NumPy 
Python :: openpyxl iter_rows skip first 
Python :: filter pandas stack overflow 
Python :: pytorch pad to square 
Python :: brython implemantation 
Python :: python turtle documentation 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =