Page tree

The license could not be verified: License Certificate has expired!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The dataspace, datatype, and data are specified in the call to create an attribute in Python:

dataset.attrs["Units"] = “Meters per second”  second”  ß Create string

attr_data = np.zeros((2,))

attr_data[0] = 100

attr_data[1] = 200

dataset.attrs.create("Speed", attr_data, (2,), “i”) ß Create Integer

C:

To create an integer attribute in C, you must create the dataspace, create the attribute, write to it and then close it in separate steps:

...

   attribute_id = H5Acreate2 (dataset_id, "Units", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT);

...