[Numpy-discussion] numpy 1.9b1 bug in pad function?

Nadav Horesh nadavh at visionsense.com
Sat Jun 14 02:11:39 EDT 2014




In [1]: import numpy as np
In [2]: a = np.arange(4)
In [3]: np.pad(a,2)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-f56fe53684b8> in <module>()
----> 1 np.pad(a,2)

/usr/lib64/python3.3/site-packages/numpy/lib/arraypad.py in pad(array, pad_width, mode, **kwargs)
   1331     elif mode is None:
   1332         raise ValueError('Keyword "mode" must be a function or one of %s.' %
-> 1333                          (list(allowedkwargs.keys()),))
   1334     else:
   1335         # Drop back to old, slower np.apply_along_axis mode for user-supplied

ValueError: Keyword "mode" must be a function or one of ['edge', 'constant', 'wrap', 'reflect', 'median', 'maximum', 'minimum', 'symmetric', 'linear_ramp', 'mean'].

In [4]: np.__version__
Out[4]: '1.9.0b1'

The documentation specify that the mode parameter is optional

I am getting the same for both python 2.7 and 3.3
OS: Gentoo linux

   Nadav

 


More information about the NumPy-Discussion mailing list