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
0
votes
0 answers

h5py module does not write character to file

I'm running into a problem with the h5py module for python. I'm trying to open a file in 'r+' mode and would like to change some characters within this file. Whenever I overwrite the data, the character is deleted. This is what I get: >>> f =…
nils
  • 43
  • 4
0
votes
1 answer

Installing h5py on Windows fails - Possibly a 32 vs 64bit issue?

I just switched my python installation to the lovely Anaconda and am trying to get the packages I use often installed and working again. Unfortunately I'm having some problems getting h5py to work - the Python 2.7 installer available from h5py.org…
Blas
  • 77
  • 2
  • 6
0
votes
1 answer

h5py, sporadic writing errors

I have some float numbers to be stored in a big (500K x 500K) matrix. I am storing them in chunks, by using arrays of variable sizes (in accordance to some specific conditions). I have a parallellised code (Python3.3 and h5py) which produces the…
user_1177868
  • 414
  • 4
  • 18
0
votes
1 answer

Performance issue with loop on datasets with h5py

I want to apply a simple function to the datasets contained in an hdf5 file. I am using a code similar to this import h5py data_sums = [] with h5py.File(input_file, "r") as f: for (name, data) in f["group"].iteritems(): print name …
M. Toya
  • 615
  • 8
  • 24
0
votes
2 answers

Storing large unstructured list in Python

Do you know any Python libraries good for storing large unstructured lists (for instance a=[0,numpy.asarray([1,2,3])])? What I've seen so far h5py doesn't support this kind of data, and pickle seems to be slow. Any other alternatives? For my purpose…
m4linka
  • 655
  • 1
  • 5
  • 6
0
votes
1 answer

Column stack and row stack with H5py to existing datasets

I am trying to use Python to column stack and row stack data I have in an HDF5 file with additional data. I am recording images from a camera and saving them to individual files. Then I want to be able to generate a single file with all of the…
Mink
  • 438
  • 8
  • 14
0
votes
0 answers

netcdf files merging in python

I am trying to run a python script for aggregation of HDF5 data files. But it shows an error. Can somebody can figure it out? I am new to python. Any help would be really appreciated. The program given below import sys import h5py import…
user2539614
  • 11
  • 1
  • 3
0
votes
1 answer

How can I define the spatial reference system for an hdf5 stack in python?

I'm new to h5py and my actual task is to create a hdf5-stack with MODIS subsets. I can create the stack with all the nice data in it but I'm not able to create or attach a spatial reference system. Goal is to load single datasets from the stack into…
rickjarzy
  • 1
  • 1
0
votes
1 answer

Fast search in a h5py or similar hierarchical database

I need a database for an online catalog; if it's possible one dataset per product. And a simple database; that's what I love h5py. The method visititems of groups it's not fast for large files. import h5py #in memory database. Not relevant for…
cu6yu4
  • 1
  • 3
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
  • 136
  • 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
  • 103
  • 1
  • 1
  • 7
-1
votes
1 answer

Is there any way to store the output of h5py's visit in a string?

I would like to ask if there any method to store the output of h5py's visit in a string? The code below is intended to print all the entries in a hdf5 file with the h5py's method visit(), but I find myself with the need to store each of the printed…
fsaizpoy
  • 149
  • 1
  • 2
  • 8
-1
votes
1 answer

Creating h5 file for storing a dataset to train super resolution GAN

I am trying to create a h5 file for storing a dataset for training a super resolution GAN. Where each training pair would be a Low resolution and a High resolution image. The dataset will contain the data in the following…
Deeptej
  • 13
  • 3
-1
votes
2 answers

h5py doesn't support NumPy dtype('U') (Unicode) and pandas doesn't support NumPy dtype('O')

I'm trying to create a .h5 file with a dataset that contains the data from a .dat file. First, I approach this using numpy: import numpy as np import h5py filename = 'VAL220408-invparms.dat' datasetname = 'EM27_104_COCCON_VAL/220408' dtvec =…
-1
votes
1 answer

Saving images with different name in folder

I tried save images in folder like this, it saves different images but every next image have all names of previously images. db = h5py.File('results/Results.h5', 'r') dsets = sorted(db['data'].keys()) for k in dsets: db = get_data() imnames…
anon