You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!rst
There seems to be a bug in set_string_function when resetting the formatting function to the default. After doing that the dtype of the array that is printed is the character string, not the numpy type. Example:
.. code-block:: python
In [1]: a=arange(10, dtype=uint16)
In [2]: a
Out[2]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=uint16)
In [3]: set_string_function(lambda x: str(x*2))
In [4]: a
Out[4]: [ 0 2 4 6 8 10 12 14 16 18]
In [5]: set_string_function(None) # reset to default
In [6]: a
Out[6]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 'H')
The ability to reset the function by using None as argument was introduced in #949.
The text was updated successfully, but these errors were encountered:
Original ticket http://projects.scipy.org/numpy/ticket/1130 on 2009-06-06 by @rgommers, assigned to unknown.
The ability to reset the function by using None as argument was introduced in #949.
The text was updated successfully, but these errors were encountered: