def python_lists_to_array(k):
    list_of_arrays = map(lambda x: x * np.ones(M), list(range(k)))
arr = np.array(list_of_arrays)
return arr

def numpy_all_the_way(k):
    arr = np.empty((N, M))
for x in range(k):
    arr[x] = x * np.ones(M)
arr.resize((k, M))
return arr
if __name__ == '__main__':
    pass
Pythonic way to create a numpy array from a list of numpy arrays