[NumPy-Tickets] [NumPy] #1446: vstack not equivalent to concatenate(x, axis=0)

NumPy Trac numpy-tickets@scipy....
Sat Apr 3 19:57:30 CDT 2010

#1446: vstack not equivalent to concatenate(x, axis=0)
 Reporter:  mforbes     |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  low         |   Milestone:          
Component:  numpy.core  |     Version:  devel   
 Keywords:  vstack      |  
 The documentation states that {{{vstack(tup) is equivalent to
 concatenate(tup, axis=0)}}}.  This fails for 1D arrays because of the
 promotion 1D->2D.

 >>> tup = [np.zeros(1), np.zeros(5)]
 >>> np.concatenate(tup, axis=0)
 array([ 0.,  0.,  0.,  0.,  0.,  0.])
 >>> vstack(tup)
 Traceback (most recent call last):
 ValueError: array dimensions must agree except for d_0

 If the current behaviour of automatic promotion is desired, then this is a
 documentation bug and a bug with the exception message (all the dimensions
 do agree except for d_0 in this case -- they don't exist!)  I will add a
 note about this on the documentation page too.

Ticket URL: <http://projects.scipy.org/numpy/ticket/1446>
NumPy <http://projects.scipy.org/numpy>
My example project

More information about the NumPy-Tickets mailing list