Maximum allowed value for a numpy data type

后端 未结 2 1234
离开以前
离开以前 2020-12-24 05:16

I am working with numpy arrays of a range of data types (uint8, uint16, int16, etc.). I would like to be able to check whether a number can be represented within the limits

2条回答
  •  独厮守ぢ
    2020-12-24 05:19

    You're looking for numpy.iinfo for integer types. Documentation here.

    There's also numpy.finfo for floating point types. Documentation here.

提交回复
热议问题