numpy.dtype.flags#

attribute

dtype.flags#

Bit-flags describing how this data type is to be interpreted.

Bit-masks are innumpy._core.multiarray as the constantsITEM_HASOBJECT,LIST_PICKLE,ITEM_IS_POINTER,NEEDS_INIT,NEEDS_PYAPI,USE_GETITEM,USE_SETITEM. A full explanationof these flags is in C-API documentation; they are largely usefulfor user-defined data-types.

The following example demonstrates that operations on this particulardtype requires Python C-API.

Examples

>>>importnumpyasnp>>>x=np.dtype([('a',np.int32,8),('b',np.float64,6)])>>>x.flags16>>>np._core.multiarray.NEEDS_PYAPI16
On this page