This code..
array = np.array([[1, 2, 3], [3, 4, 5]])
for k in range(0, len(array)):
final_array = np.hstack(array[k, :])
print(final_array)
Will only print the last [3,4,5] not the entire array in an hstack.
I tried doing final_array += np.hstack(array[k, :]), but Python gives me an error. Also tried to reshape the array before concatenation.
My goal is to add the array items to the hstack in reverse order so I think I need to use a loop -- and not just insert the entire array into an hstack call.
All the examples I've found online are simple where you have two arrays and you call hstack. But, I haven't found any that combine successive arrays in a loop.
I'm assuming this is simple, but the solution escapes me.
Thanks in advance for suggestions.