Skip to content

Byte data from flatbuffer vector into a Python NumPy array #4090

Description

@SkyToGround

I have a flatbuffer structure which holds some binary data. A simple example illustrating this shown below:

table NDArray {
   name:string;
  dataType:DType;
  pData:[ubyte];
}

The data in pData might actually be an array of int32 or some other type and I want to feed this data into the numpy-function fromstring() to get that array without having to read every byte individually. E.g.:

my_array = numpy.fromstring(fb_raw_data, dtype=numpy.int32)

Is this possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions