fork download
  1. import timeit
  2.  
  3. print(timeit.timeit("list_1[:][:]",
  4. setup="list_1 = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]"))
  5.  
  6. print(timeit.timeit("list_2[:,]",
  7. setup="import numpy as np; list_2 = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])"))
Success #stdin #stdout 0.36s 92736KB
stdin
Standard input is empty
stdout
0.1302607785910368
0.1592536810785532