How to create NULL dataspace using H5Py


I was trying to write a HDF5 file using the H5Py package. What I wanted to create was a HDF5 dataset whose dataspace is NULL. This is what I wanted (when dumped by h5dump):


I could not find any input parameters to the create_dataset call that could achieve this. The closest was by passing an empty tuple to the shape parameter.

However, that created a dataset with this structure:

(0): NULL


It turns out that the H5Py had no support to create a NULL dataspace! Thankfully, support for this had just been added to v2.7 as mentioned here.

I used the latest version of H5Py and was able to create a dataset with NULL dataspace. This is done by passing None to the shape parameter.

Tried with: Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.