枚举 NpyDataType

    • 枚举常量详细资料

      • f2

        public static final NpyDataType f2
        16 bit floating point numbers
      • f4

        public static final NpyDataType f4
        32 bit floating point numbers
      • f8

        public static final NpyDataType f8
        64 bit floating point numbers
      • i1

        public static final NpyDataType i1
        8-bit signed integers
      • i2

        public static final NpyDataType i2
        16 bit signed integers
      • i4

        public static final NpyDataType i4
        32 bit signed integers
      • i8

        public static final NpyDataType i8
        64 bit signed integers
      • u1

        public static final NpyDataType u1
        8-bit unsigned integers
      • u2

        public static final NpyDataType u2
        16 bit unsigned integers
      • u4

        public static final NpyDataType u4
        32 bit unsigned integers
      • u8

        public static final NpyDataType u8
        64 bit unsigned integers
    • 方法详细资料

      • values

        public static NpyDataType[] values()
        按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:
        for (NpyDataType c : NpyDataType.values())
            System.out.println(c);
        
        返回:
        按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
      • valueOf

        public static NpyDataType valueOf​(String name)
        返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
        参数:
        name - 要返回的枚举常量的名称。
        返回:
        返回带有指定名称的枚举常量
        抛出:
        IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量
        NullPointerException - 如果参数为空值
      • symbol

        public String symbol()
        Get the NPY symbol of the data type.
        返回:
        the NPY symbol of the data type, e.g. i4.
      • size

        public int size()
        For fixed sized data types, returns the number of bytes that are required to store a value of this type. Returns 0 for variable sized types (the string types S and U). This method is similar to the NumPy method numpy.dtype.itemsize.
        
         >>> import numpy as np
         >>> np.dtype('i4').itemsize
         4
         >>> np.dtype('U').itemsize
         0
         
        返回:
        for fixed sized types the number of bytes to store a single value, for variable sized types like strings 0.
      • of

        public static NpyDataType of​(String dtype)
        Tries to find the data type for the given symbol. The behavior is a bit like numpy.dtype('[the type name or symbol]'). The given symbol can have a prefix that indicates the byte order.
        参数:
        dtype - the data type symbol (e.g. i4, int32, <i4)
        返回:
        the data type or null if there is no matching type defined.