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
2 answers

Unpacking data with h5py

I want to write numpy arrays to a file and easily load them in again. I would like to have a function save() that preferably works in the following way: data = [a, b, c, d] save('data.h5', data) which then does the following h5f =…
johnbaltis
  • 1,413
  • 4
  • 14
  • 26
0
votes
1 answer

python setup.py config --include-dirs not work when install h5py

the hdf5 library has been installed here: ~/soft/lib/packages/hdf5-1.8.14-linux-centos5-x86_64-gcc412-shared/. I install h5py using the following command: python setup.py config…
pengchy
  • 732
  • 2
  • 14
  • 26
0
votes
0 answers

gdal.Open fails after h5py.File() but only on Linux

I use Python and I open a hdf5 file using h5py to get some info that is not viewed by gdal. Then, I open the same file using gdal.Open(). On windows, everything works. But when deployed on Linux (Ubuntu) it fails. Gdal compains that RuntimeError:…
visoft
  • 503
  • 5
  • 13
0
votes
2 answers

Add constant value to an array which is stored in an hdf5 file

I want to add a constant value to an array. The array is stored in an hdf5 file. f = h5py.File(fileName) f['numbers'] = f['numbers'] + 5 gives me an error that TypeError: unsupported operand type(s) for +: 'Dataset' and 'int' how should I do it?
Sounak
  • 4,803
  • 7
  • 30
  • 48
0
votes
0 answers

Can I update a part of HDF5 file using h5py python library?

Can't find any command at http://docs.h5py.org/en/latest/high/file.html to do that.
Comrade Che
  • 619
  • 8
  • 25
0
votes
2 answers

Install h5py in Mac OS X 10.6.3

I'm trying to install h5py in Mac OS X 10.6.3. First I installed HDF5 1.8, which used the following commands: ./configure \ --prefix=/Library/Frameworks/Python.framework/Versions/Current \ --enable-shared \ --enable-production \ --enable-threadsafe…
YuQing Zhang
  • 779
  • 1
  • 5
  • 17
0
votes
1 answer

Storing python lmfit object in hdf5 file

I'm trying to store the results of a fit I made using the lmfit package for python in an hdf5 file using the h5py package for python. Currently I find myself recreating the structure of the data object by hand (i.e. loop over all keys in…
Adriaan Rol
  • 420
  • 2
  • 4
  • 12
0
votes
1 answer

Is it possible to slice keys in h5py using python 3, without forming a list?

I am using h5py to read in data from an HDF5 file, and have found that code which worked using Python 2 does not work using Python 3. The file is formatted such that 2D frames of data are present as distinct datasets, which I want to read into a 3D…
Ajean
  • 5,528
  • 14
  • 46
  • 69
0
votes
1 answer

Large multidimensional array causes memory leak, hope to solve by h5py dataset

Here is a simple extraction of what I intend to do loop1 = range(10) loop2 = range(10) loop3 = range(100) list = [] for l in loop1: for n in loop2: for m in loop3: list.append([l,n,m]) dSet = [] for l in list: matrix =…
Theodora
  • 571
  • 4
  • 11
0
votes
1 answer

H5py: fast way to save list of list of numpy.ndarray?

How can I save and read efficiently a list of list of numpy.ndarray, with h5py? E.g. I want to save/read: Y = np.arange(3**3).reshape(3,3,3) X = [[Y,Y],[Y,Y,Y],[Y]] I am looking for the most efficient (no double loops etc) solution.
memecs
  • 7,196
  • 7
  • 34
  • 49
0
votes
1 answer

Fast slicing .h5 files using h5py

I am working with .h5 files with little experience. In a script I wrote I load in data from an .h5 file. The shape of the resulting array is: [3584, 3584, 75]. Here the values 3584 denotes the number of pixels, and 75 denotes the number of time…
The Dude
  • 3,795
  • 5
  • 29
  • 47
0
votes
1 answer

Statistical analysis of .h5 files (SPSS?)

I have two sets of data in separated .h5 files (Hierarchical Data Format 5, HDF5), obtained with python scripts, and I would like to perform statistical analysis to find correlations between them. My experience here is limited; I don't know any R. I…
Scipio
  • 313
  • 2
  • 15
0
votes
0 answers

How to save a Python dtype('O') in an HDF5

According to this link the NumPy generic object ("O") datatype is not supported by h5py but I really need to fine a way to store my object. I have designed my file and already stored other datatypes into it and don't wanna move to other data…
Am1rr3zA
  • 7,115
  • 18
  • 83
  • 125
0
votes
1 answer

h5py install on windows cannot open hdf5dll18.lib and hdf5_hldll.lib

After downloading hdf5-1.8.12-win32-vs10shared.zip and installing (adds dir to PATH) there is still no hdf5dll18.lib and hdf5_hldll.lib available. So python3 setup.py install fails (python3 is my rename). My h5py is from github. Workaround:…
Roland Puntaier
  • 3,250
  • 30
  • 35
0
votes
1 answer

What does h5py broadcasting refers to?

The h5py documentations (http://www.h5py.org/docs/high/dataset.html) says the following: Importantly, h5py does not use NumPy to do broadcasting before the write... >>> dset2 = f.create_dataset("MyDataset", (1000,1000,1000), 'f') >>> data =…
methane
  • 667
  • 2
  • 8
  • 17