Questions tagged [h5py]

h5py is a NumPy-compatible Python module for handling The Hierarchical Data Format (HDF5) files.

h5py is a NumPy-compatible Python module for handling The Hierarchical Data Format (HDF5) files.

Main features

  • Free (BSD licensed)
  • limited dependencies (Python, NumPy, HDF5 libs.)
  • includes both a low level c-like HDF5 interface and a high level Python/NumPy style interface
  • directly interact with datasets using NumPy metaphors, such as slicing
  • datatypes specified using standard NumPy dtype objects

Some links to get started

1301 questions
-1
votes
1 answer

Accessing all the data contained in an h5 file with python

After I load an h5 files and then check the keys, is there any other data that can be stored in the h5 that I might be missing? For example: import h5py a = '/path/to/file.h5' a_h5 = h5py.File(a) a_h5.keys()
Nolohice
  • 339
  • 4
  • 15
-1
votes
1 answer

How to deal with large arrays in python?

I have very large arrays which are needed to be stored on disk. How can I do that? I tried using h5py, I read the documentation and found the issue with it is its 2nd dimension can have maximum number of 1024. How can I deal with an array that have…
Kavan
  • 331
  • 1
  • 4
  • 13
-1
votes
1 answer

Working on many small matrices

I'm currently working on many small 6x6 matrices: shape A = (N, N, N, 6, 6) with N is about 500. I store these matrices in a HDF5 file by Pytables (http://www.pytables.org). I want to do some calculations on these matrices, say inverting,…
user2863620
  • 635
  • 3
  • 10
  • 17
-2
votes
1 answer

Save a list of dictionaries with numpy arrays

I have a dataset composed as: dataset = [{"sample":[numpy array (2048,3) shape], "category":"Cat"}, ....] Each element of the list is a dictionary containing a key "sample" and its value is a numpy array that has shape (2048,3) and the category is…
Klinda
  • 35
  • 6
-2
votes
1 answer

KeyError: "Unable to open object (object 'xxxxxx' doesn't exist)"

In part of my code, I create a dataset with h5py.File('xxxxxx.h5', 'w') as f: f.create_dataset('xxxx', data=xxxxxx). The code generates the .h5 file and stores it in the specified location, but once I want to open the file, it give me the…
-2
votes
1 answer

Why am I getting and how to solve ValueError: zero-size array to reduction operation maximum which has no identity

I am making a image-classification CNN and I am trying to create a h5py file with the preprocessed images but I get a ValueError, which says "zero-size array to reduction operation maximum which has no identity". Can someone please help me: I don't…
-2
votes
1 answer

Read .mat file in Python

I know how to call any data from the attached file (URL) by Python except any data connected with the name "ROI". For example, you can check "data_dic_save/displacements/roi_ref_formatted". I want to use data from this path in my work (like mask and…
-2
votes
1 answer

Saving mixed structured data with h5py

I have a dataset with 100,000 entries, each of the form: { attr1 float[300] attr2 float[300] attr3 float[300] attr4 float attr5 float attr6 float } What is the most efficient way to store this in an .hdf5 file?
user7867665
  • 852
  • 7
  • 25
-2
votes
1 answer

Can not read .mat file into python

I have been trying for days, searching for the proper way to read this file in my python project. Which is an ordinary matlab datastructure file. https://drive.google.com/open?id=1E1w1eQn6pTcQ1lkhGMJzmB5ugtmaDPht I am familiar about how to read h5…
mahmoud fathy
  • 361
  • 1
  • 7
  • 17
-3
votes
1 answer

Do not understand the classes part and reshape from reading a h5 dataset file

Hello can somebody explain step by step what's hapening in following code? Escpecially the part classes and the reshape? tnx def load_data(): train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r") train_set_x_orig =…
Gerrit
  • 25
  • 8
-3
votes
1 answer

Code for -Python plot

I have never used Python and I saw one piece of code from a manual and I would love to know what does it mean. This is the code from the manual: import h5py h5file = h5py.File('Output/ScottCreek250b/simulation.results.DY.hdf5') …
Yu Deng
  • 1,051
  • 4
  • 18
  • 35
1 2 3
86
87