0

I know it doesn't make sense, but I executed the command:

numpy.arange(0, 5, 1, numpy.bool_)

And it returned an error ValueError: no fill-function for data-type.. All data types seems to be working except boolean which return this error.

I was expecting False, True, True, True, True, what causes that error?

1 Answers1

2

Executing

numpy.arange(0, 2, 1, numpy.bool_)

Works fine, becuase np.bool_ type is still meaningful for range [0,2).
However, what is the meaning of range [0,5) for type bool_??
This is the error you get - numpy tries to tell you that you are asking for values in invalid range.

Shai
  • 111,146
  • 38
  • 238
  • 371
  • 1
    I was under the impression that any non zero number is True in python, isn't that the case? –  Aug 03 '17 at 08:25