Package numpy.core
Class NDArrayUtil
- java.lang.Object
-
- numpy.core.NDArrayUtil
-
public class NDArrayUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<?>getContent(NDArray array)Gets the payload of a one-dimensional array.static java.util.List<?>getContent(NDArray array, java.lang.String key)Gets the payload of the specified dimension of a multi-dimensional array.static int[]getShape(NDArray array)static java.util.List<java.lang.Object>parseArray(java.io.InputStream is, java.lang.Object descr, int length, java.lang.Integer numpyArrayAlignmentBytes)static java.lang.ObjectparseData(java.io.InputStream is, java.lang.Object descr, java.lang.Object[] shape)static java.lang.ObjectparseData(java.io.InputStream is, java.lang.Object descr, java.lang.Object[] shape, java.lang.Integer numpyArrayAlignmentBytes)static java.util.Map<java.lang.String,?>parseDict(java.lang.String string)static java.util.List<java.lang.Object[]>parseMultiArray(java.io.InputStream is, java.util.List<java.lang.Object> descrs, int length, java.lang.Integer wSize, java.lang.Integer numpyArrayAlignmentBytes)static NDArrayparseNpy(java.io.InputStream is)https://numpy.org/doc/stable/reference/generated/numpy.lib.format.htmlstatic bytereadByte(java.io.InputStream is)static doublereadDouble(java.io.InputStream is, java.nio.ByteOrder byteOrder)static floatreadFloat(java.io.InputStream is, java.nio.ByteOrder byteOrder)static intreadInt(java.io.InputStream is, java.nio.ByteOrder byteOrder)static longreadLong(java.io.InputStream is, java.nio.ByteOrder byteOrder)static java.lang.ObjectreadObject(java.io.InputStream is)static shortreadShort(java.io.InputStream is, java.nio.ByteOrder byteOrder)static java.lang.StringreadString(java.io.InputStream is, int size)static java.lang.StringreadUnicode(java.io.InputStream is, java.nio.ByteOrder byteOrder, int size)static intreadUnsignedByte(java.io.InputStream is)static intreadUnsignedShort(java.io.InputStream is, java.nio.ByteOrder byteOrder)static NDArraytoArray(java.util.List<?> data)
-
-
-
Method Detail
-
getShape
public static int[] getShape(NDArray array)
-
getContent
public static java.util.List<?> getContent(NDArray array)
Gets the payload of a one-dimensional array.
-
getContent
public static java.util.List<?> getContent(NDArray array, java.lang.String key)
Gets the payload of the specified dimension of a multi-dimensional array.- Parameters:
key- The dimension.
-
toArray
public static NDArray toArray(java.util.List<?> data)
-
parseNpy
public static NDArray parseNpy(java.io.InputStream is) throws java.io.IOException
https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html- Throws:
java.io.IOException
-
parseData
public static java.lang.Object parseData(java.io.InputStream is, java.lang.Object descr, java.lang.Object[] shape) throws java.io.IOException- Throws:
java.io.IOException
-
parseData
public static java.lang.Object parseData(java.io.InputStream is, java.lang.Object descr, java.lang.Object[] shape, java.lang.Integer numpyArrayAlignmentBytes) throws java.io.IOException- Throws:
java.io.IOException
-
parseArray
public static java.util.List<java.lang.Object> parseArray(java.io.InputStream is, java.lang.Object descr, int length, java.lang.Integer numpyArrayAlignmentBytes) throws java.io.IOException- Throws:
java.io.IOException
-
parseMultiArray
public static java.util.List<java.lang.Object[]> parseMultiArray(java.io.InputStream is, java.util.List<java.lang.Object> descrs, int length, java.lang.Integer wSize, java.lang.Integer numpyArrayAlignmentBytes) throws java.io.IOException- Throws:
java.io.IOException
-
parseDict
public static java.util.Map<java.lang.String,?> parseDict(java.lang.String string)
-
readByte
public static byte readByte(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedByte
public static int readUnsignedByte(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readShort
public static short readShort(java.io.InputStream is, java.nio.ByteOrder byteOrder) throws java.io.IOException- Throws:
java.io.IOException
-
readUnsignedShort
public static int readUnsignedShort(java.io.InputStream is, java.nio.ByteOrder byteOrder) throws java.io.IOException- Throws:
java.io.IOException
-
readInt
public static int readInt(java.io.InputStream is, java.nio.ByteOrder byteOrder) throws java.io.IOException- Throws:
java.io.IOException
-
readLong
public static long readLong(java.io.InputStream is, java.nio.ByteOrder byteOrder) throws java.io.IOException- Throws:
java.io.IOException
-
readFloat
public static float readFloat(java.io.InputStream is, java.nio.ByteOrder byteOrder) throws java.io.IOException- Throws:
java.io.IOException
-
readDouble
public static double readDouble(java.io.InputStream is, java.nio.ByteOrder byteOrder) throws java.io.IOException- Throws:
java.io.IOException
-
readObject
public static java.lang.Object readObject(java.io.InputStream is) throws java.io.IOException- Throws:
java.io.IOException
-
readString
public static java.lang.String readString(java.io.InputStream is, int size) throws java.io.IOException- Throws:
java.io.IOException
-
readUnicode
public static java.lang.String readUnicode(java.io.InputStream is, java.nio.ByteOrder byteOrder, int size) throws java.io.IOException- Throws:
java.io.IOException
-
-