In C++, I can create a array like...
int* a = new int[10];
in python,I just know that I can declare a list,than append some items,or like..
Python has nothing built-in to support this. Do you really need to optimize it so much as I don't think that appending will add that much overhead.
However, you can do something like l = [None] * 1000
.
Alternatively, you could use a generator.
fix_array = numpy.empty(n, dtype = object)
where n is the size of your array
though it works, it may not be the best idea as you have to import a library for this purpose. Hope this helps!
your_list = [None]*size_required