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

1070 questions
0
votes
1 answer

when is h5py useful in storing data?

I am using h5py to store data using python import h5py def store(eigenvalues,eigenvectors,name='01_'): datafile = h5py.File(name+'data.h5', 'w') datafile['eigenvalues'] = eigenvalues datafile['eigenvectors'] =…
Ars3nous
  • 126
  • 1
  • 1
  • 8
0
votes
1 answer

python recursive function and returning non-mutable dictionary

I'm trying to make function VisitAllObjects accept different files and return a dictionary. But what I have currently points to the same name? So once gdata is ran, fdata changes to gdata. How can I make it so fdata and gdata equal their respected…
tlab
  • 83
  • 1
  • 1
  • 6
-1
votes
2 answers

how to create opaque dataset with a given tag in h5py

I'm trying to recreate an HDF5 file using h5py that stores binary data (e.g. JPEG compressed images) as an OPAQUE dataset using the tag to store the MIME type so they can be easily decoded later. The only way I've been able to solve this is using…
Sam Mason
  • 11,177
  • 1
  • 29
  • 42
-1
votes
1 answer

write HDF h5 dataset (via h5py) which is a mix of string and numpy list

I have the following two datasets (I have several of these tuples): filename_string: "something" filename_list: [1,2,3,4,5] # this is a numpy array. Id like to know how to write this in a compact format via h5py. The goal is to have the end user…
JohnJ
  • 5,400
  • 10
  • 39
  • 66
-1
votes
1 answer

Is there a way to save each HDF5 data set as a .csv column?

I'm struggling with a H5 file to extract and save data as a multi column csv. as shown in the picture the structure of h5 file consisted of main groups (Genotypes, Positions, and taxa). The main group, Genotypes contains more than 1500 subgroups…
-1
votes
1 answer

Broadcast error HDF5: Can't broadcast (3, 2048, 1, 1) -> (4, 2048, 1, 1)

I have received the following error: TypeError: Can't broadcast (3, 2048, 1, 1) -> (4, 2048, 1, 1) I am extracting features and placing them into a hdf5 dataset like this: array_40 = hdf5_file.create_dataset( …
TSRAI
  • 19
  • 7
-1
votes
1 answer

AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__'

I am using python 3.6,Tensorflow 1.3, Keras 2.1.2 I was importing Resnet50 and I got this error"ImportError: load_model requires h5py" so I used conda install h5py but then I got this error knowing that the installed version of h5py is 2.9.0enter…
-1
votes
1 answer

how to display elements of arrays in a .mat file in python

This is the first time that I try to work with ".mat" files. I am going to use the data of a ".mat" file, but the elements of the arrays can not be opened. Can any one help me? Since the "*.mat" file is > 7.3, I can not use Scipy.io import numpy as…
Haj Nasser
  • 154
  • 12
-1
votes
1 answer

OSError: No such file or directory

When I try to open .h5 file, it shows the following error Traceback (most recent call last): File "C:\Users\VW3ZTWS\PycharmProjects\Data_Collection_and_learnings\venv\lib\site-packages\IPython\core\interactiveshell.py", line 2869, in run_code …
Mari
  • 604
  • 4
  • 18
-1
votes
2 answers

importing illustris hdf5 file into numpy array using h5py

I am working on importing a rather large hdf5 file of illustris galaxy simulation code using h5py. I have the file displayed here if anyone wants to see - it is 1.96 GB. https://drive.google.com/file/d/0B1Kj475OJBnuaFBIS2FhTFpvNkk/view?usp=sharing I…
W. Ojanen
  • 1
  • 1
-1
votes
1 answer

How to query a PyTables frame_table saved via a Pandas Dataframe?

I have the following pandas dataframe: import pandas as pd df = pd.read_table('fname.dat') So, I create/ open an existing HDFStore file: store = pd.HDFStore('store.h5') To index a subset of columns, I simply use store.append('key_name', df,…
ShanZhengYang
  • 12,508
  • 35
  • 106
  • 190
-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
  • 3
  • 13
-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
  • 311
  • 1
  • 3
  • 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
  • 483
  • 2
  • 8
  • 16
-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…
1 2 3
71
72