0

Why does this give me false?

isinstance(np.int32(3.0),np.int)
Raghul Raj
  • 1,428
  • 9
  • 24

1 Answers1

1

Because np.int is the same as python int data type.

Check Difference between np.int, np.int_, int, and np.int_t in cython for more info.

>>> np.int
<class 'int'>

To check with numpy.int32, you can try with np.int_,

>>> isinstance(np.int32(3.0),np.int_)
True
shaik moeed
  • 5,300
  • 1
  • 18
  • 54