Aug-30-2021, 11:58 PM
Hello everyone,
I hope you are well.
I wonder which of those two methods for dealing with arrays would be faster in python:
method 1: define array at the beginning of the code as np.zeros for example, then fill the elements x[1] , x[2] ... etc, within the code.
method 2: define array at the beginning of the code as empty array: x = [] , and then fill the elements x[1] , x[2] ... etc, within the code.
Thanks
I hope you are well.
I wonder which of those two methods for dealing with arrays would be faster in python:
method 1: define array at the beginning of the code as np.zeros for example, then fill the elements x[1] , x[2] ... etc, within the code.
method 2: define array at the beginning of the code as empty array: x = [] , and then fill the elements x[1] , x[2] ... etc, within the code.
Thanks