Simple question: what is the advantage of each of these methods. It seems that given the right parameters (and ndarray shapes) they all work seemingly equivalently. Do some
In IPython you can look at the source code of a function by typing its name followed by ??. Taking a look at hstack we can see that it's actually just a wrapper around concatenate (similarly with vstack and column_stack):
np.hstack??
def hstack(tup):
...
arrs = [atleast_1d(_m) for _m in tup]
# As a special case, dimension 0 of 1-dimensional arrays is "horizontal"
if arrs[0].ndim == 1:
return _nx.concatenate(arrs, 0)
else:
return _nx.concatenate(arrs, 1)
So I guess just use whichever one has the most logical sounding name to you.