[Numpy-discussion] Change in behavior of np.concatenate for upcoming release

Travis Oliphant travis@continuum...
Thu Sep 13 13:16:50 CDT 2012


>>> Yep, that'd be a good idea. Want to write a patch? :-)
>> 
>> https://github.com/numpy/numpy/pull/440
> 
> Thinking about the other thread, and the 'number of elements' check, I
> noticed this:
> 
> In [51]: np.__version__
> Out[51]: '1.6.1'
> 
> In [52]: r4 = range(4)
> 
> In [53]: r3 = range(3)
> 
> In [54]: np.concatenate((r4, r3), None)
> Out[54]: array([0, 1, 2, 3, 0, 1, 2])
> 
> but:
> 
> In [46]: np.__version__
> Out[46]: '1.7.0rc1.dev-ea23de8'
> 
> In [47]: np.concatenate((r4, r3), None)
> ---------------------------------------------------------------------------
> ValueError                                Traceback (most recent call last)
> /Users/mb312/tmp/<ipython-input-47-e354b8880702> in <module>()
> ----> 1 np.concatenate((r4, r3), None)
> 
> ValueError: all the input arrays must have same number of elements
> 
> The change requiring the same number of elements appears to have been
> added explicitly by Mark in commit 9194b3af  .  Mark - what was the
> reason for that check?

This looks like a regression.   That should still work. 

-Travis



> 
> Best,
> 
> Matthew
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion



More information about the NumPy-Discussion mailing list