Hacker News new | past | comments | ask | show | jobs | submit login

As an occasional numpy contributor, I would call this a bug.



Yes, the expected output is xx›


  xxx›


xxxₓ


xxxv, actually.

(it makes sense if you know why Roman numerals look the way they do)


Good point - I found it after it caused a really weird bug in a library I use. I'll open an issue on github...


Turns out it's deprecated:

    >>> import warnings
    >>> warnings.simplefilter('always')
    >>> 'x'*np.float64(3.5)
    __main__:1: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
    'xxx'


I get no such warning with 2.7.9 on linux.


It would be a warning from numpy, not Python. That comes from numpy/core/src/multiarray/conversion_utils.c and was added 2013-04-13 , which would be for NumPy 1.8, I believe.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: