Visitar URL original
Fix NumPy tutorial notebook typos and examples by dev-javedali · Pull Request #349 · codebasics/py · GitHub
Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up numpy_tutorial.py formatting and remove unused import
Removed the unused 'import sys' statement and added PEP8 spacing around operators, commas, and assignments (e.g. a1=np.arange -> a1 = np.arange, x+y -> x + y).
  • Loading branch information
dev-javedali committed Sep 9, 2026
commit 633a5948fd2ab94b31dfdb7a2b8c95efe3d76f7b
15 changes: 6 additions & 9 deletions numpy/numpy_tutorial.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import numpy as np
import time
import sys
SIZE = 1000000
l1 = range(SIZE)
l2 = range(SIZE)
a1=np.arange(SIZE)
a2=np.arange(SIZE)
a1 = np.arange(SIZE)
a2 = np.arange(SIZE)

# python list
start = time.time()
result = [(x+y) for x,y in zip(l1,l2)]
print("python list took: ",(time.time()-start)*1000)
result = [(x + y) for x, y in zip(l1, l2)]
print("python list took: ", (time.time() - start) * 1000)
# numpy array
start= time.time()
start = time.time()
result = a1 + a2
print("numpy took: ", (time.time()-start)*1000)


print("numpy took: ", (time.time() - start) * 1000)