numpy download
python numpy tutorial
how to install numpy
numpy documentation
numpy python 3
numpy documentation pdf
numpy functions
numpy array
------------------------------------------------------------------------------------------------------------------------------------------------
import time
import numpy as np
size_of_vec = 1000
def pure_python_version():
t1 = time.time()
X = range(size_of_vec)
Y = range(size_of_vec)
Z = [X[i] + Y[i] for i in range(len(X)) ]
return time.time() - t1
def numpy_version():
t1 = time.time()
X = np.arange(size_of_vec)
Y = np.arange(size_of_vec)
Z = X + Y
return time.time() - t1
t1 = pure_python_version()
t2 = numpy_version()
print(t1, t2)
print("Numpy is in this example " + str(t1/t2) + " faster!")
--------------------------------------------------------------------------------------------------------------------------------------------------
import numpy as np
import time
import sys
let's declare the size
Size = 100000
Creating two lists
list1 = range(Size)
list2 = range(Size)
Creating two NumPy arrays
arr1 = np.arange(Size)
arr2 = np.arange(Size)
Calculating time for Python list
start = time.time()
result = [(x ,y) for x, y in zip(list1, list2)]
print("Time for Python List in msec: ", (time.time() - start) * 1000)
Calculating time for NumPy array
start = time.time()
result = arr1 ,arr2
print("Time for NumPy array in msec: ", (time.time()- start) * 1000)
print("\nThis means NumPy array is faster than Python List")
--------------------------------------------------------------------------------------------------------------------------------
thanks
**************************************************************************************
please subscribe
like
share
with your friends
**************************************************************************************
On this page of the site you can watch the video online python numpy || numpy || why numpy || series with a duration of hours minute second in good quality, which was uploaded by the user CSE TECH'S 10 December 2018, share the link with friends and acquaintances, this video has already been watched 116 times on youtube and it was liked by 11 viewers. Enjoy your viewing!