[Numpy-tickets] [NumPy] #352: .repeat on slice gets wrong slice

NumPy numpy-tickets at scipy.net
Wed Oct 18 11:46:58 CDT 2006


#352: .repeat on slice gets wrong slice
------------------------+---------------------------------------------------
 Reporter:  mrovner     |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:          
Component:  numpy.core  |     Version:          
 Severity:  blocker     |    Keywords:          
------------------------+---------------------------------------------------
 I got strange discrepance between 2.4+0.9.8 and 2.5+1.0rc2:
 {{{
 model_lib_pool %0 !5019$ python2.5
 Python 2.5 (r25:51908, Oct 17 2006, 16:16:21)
 [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-14)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from numpy import *
 >>> a=arange(12).reshape(4,3)
 >>> a
 array([[ 0,  1,  2],
         [ 3,  4,  5],
         [ 6,  7,  8],
         [ 9, 10, 11]])
 >>> a[:,2]
 array([ 2,  5,  8, 11])
 >>> a[:,2].repeat(3)
 array([2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5])
 >>> import numpy
 >>> numpy.__version__
 '1.0rc2'
 >>>
 }}}
 Old version looks right:
 {{{
 Python 2.4.2 (#5, Jun  2 2006, 18:33:20)
 [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-20)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> from numpy import *
 >>> a=arange(12).reshape(4,3)
 >>> a
 array([[ 0,  1,  2],
         [ 3,  4,  5],
         [ 6,  7,  8],
         [ 9, 10, 11]])
 >>> a[:,2]
 array([ 2,  5,  8, 11])
 >>> a[:,2].repeat(3)
 array([ 2,  2,  2,  5,  5,  5,  8,  8,  8, 11, 11, 11])
 >>> import numpy
 >>> numpy.__version__
 '0.9.8'
 >>>
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/352>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list