Question about How fast are NumPy ops.ipynb
GitwellAnyohub opened this issue · 0 comments
GitwellAnyohub commented
Hey just wondering, for the How fast are NumPy ops.ipynb
When considering the speed for the log(10) of all the elements in the Numpy array a1, shouldn't you also include the creation of the initial Numpy array?
Line 50 is this:
t1=time.time()
a2=np.log10(a1)
t2 = time.time()
print("With direct NumPy log10 method it took {} seconds".format(t2-t1))
speed.append(t2-t1)
But isn't it more fair to make it this:
t1=time.time()
a1 = np.array(l1)
a2=np.log10(a1)
t2 = time.time()
print("With direct NumPy log10 method it took {} seconds".format(t2-t1))
speed.append(t2-t1)
Considering that it is an additional step not present in the other methods? In your code the bolded line is line 40.