-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
I find a disarrangement of the columns when I want to display a structured numpy array.
To Reproduce
The bug can be reproduced by the following python code.
# create a structured array.
dtype = np.dtype(
{"names": ['1', '0', '2'], "formats": [np.float64, np.float64, np.float64]}
)
data = np.array([(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)], dtype=dtype)
# save.
file = h5py.File("./test.h5", 'w')
file.create_dataset("a", data=data, dtype=dtype)
file.close()Expected behaviour
We can read from the file as follows:
file = h5py.File("./test.h5", 'r')
print(file["a"]["0"]) #[2. 5.]
print(file["a"]["1"]) #[1. 4.]
print(file["a"]["2"]) #[3. 6.]
file.close()Screenshots
There is no problem using non numeric string. But in the above example, it seems that the columns are rearranged according to the values of the array index, which I think is a confusing behavior.
Context
I run the above example in the vscode plugin. (h5web.vscode-h5web v0.1.7)
axelboc
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working