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