[NumPy-Tickets] [NumPy] #1712: concatenate ignores 'axis' argument when given 1-dimensional arrays

NumPy Trac numpy-tickets@scipy....
Thu Jan 13 19:34:25 CST 2011


#1712: concatenate ignores 'axis' argument when given 1-dimensional arrays
-----------------------+----------------------------------------------------
 Reporter:  chairmanK  |       Owner:  somebody   
     Type:  defect     |      Status:  new        
 Priority:  normal     |   Milestone:  Unscheduled
Component:  Other      |     Version:  devel      
 Keywords:             |  
-----------------------+----------------------------------------------------
 I am surprised that concatenate does not complain when I specify an
 impossible axis.

 {{{
 >>> a = numpy.zeros((2,))
 >>> b = numpy.ones((3,))
 >>> numpy.concatenate((a, b), axis=0)
 array([ 0.,  0.,  1.,  1.,  1.])
 >>> numpy.concatenate((a, b), axis=20)
 array([ 0.,  0.,  1.,  1.,  1.])
 >>> numpy.concatenate((a, b), axis=-20)
 array([ 0.,  0.,  1.,  1.,  1.])
 >>> numpy.concatenate((a, b), axis=23423432234234234234L)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 OverflowError: long int too large to convert to int
 >>> numpy.concatenate((a.reshape((a.size, 1)), b), axis=-20)
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 ValueError: bad axis1 argument to swapaxes
 >>> numpy.__version__
 '2.0.0.dev-f72c605'
 }}}

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


More information about the NumPy-Tickets mailing list