DMang
DMang

Reputation: 53

H5 Hexadecimal data

When I load a .h5 file into the spyder environment using h5py, I no longer see the hexadecimal data that was in the original file.

Does Python convert the hex information to uint8 automatically?

Upvotes: 0

Views: 307

Answers (2)

Pierre de Buyl
Pierre de Buyl

Reputation: 7293

HDF5 does not store hexadecimal data, only numbers and characters. The documentation of HDF5 lists the supported datatypes.

What you interpret as hexadecimal data is very likely integer data. You can have a look at the datatypes in your file by typing

h5dump -A filename.h5

The -A flag means: list the attributes (i.e. the metadata). You can look at a part of the file with

h5dump -A -g name_of_a_group filename.h5

Upvotes: 1

Lawrence Du
Lawrence Du

Reputation: 131

Python will probably convert those values to int32. Use hex() to see those values in hexadecimal form, and use bitwise operations for manipulation. You can also use bin() to see things in binary

hex(2) '0x2'

Upvotes: 0

Related Questions