h5py_File_read_ndarray_utf8#

pybrops.core.util.h5py.h5py_File_read_ndarray_utf8(h5file, fieldname)[source]#

Read a numpy.ndarray from a file. If the datatype is bytes, convert to a utf-8 encoded str format, otherwise keep as is.

Bare-bones function. Does not perform any type checks on inputs.

Parameters:
  • h5file (h5py.File) – An open, readable HDF5 file stream.

  • fieldname (str) – Name of the field from which to read.

Returns:

out – An object array containing strings read from the HDF5 file.

Return type:

numpy.ndarray