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
29
votes
4 answers

Deleting hdf5 dataset using h5py

Is there any way to remove a dataset from an hdf5 file, preferably using h5py? Or alternatively, is it possible to overwrite a dataset while keeping the other datasets intact? To my understanding, h5py can read/write hdf5 files in 5 modes f =…
hsnee
  • 543
  • 2
  • 6
  • 17
28
votes
1 answer

Pandas can't read hdf5 file created with h5py

I get pandas error when I try to read HDF5 format files that I have created with h5py. I wonder if I am just doing something wrong? import h5py import numpy as np import pandas as pd h5_file = h5py.File('test.h5',…
Masha L.
  • 301
  • 1
  • 3
  • 5
26
votes
2 answers

how to export HDF5 file to NumPy using H5PY?

I have an existing hdf5 file with three arrays, i want to extract one of the arrays using h5py.
l.z.lz
  • 393
  • 1
  • 4
  • 13
24
votes
3 answers

Fastest way to write HDF5 files with Python?

Given a large (10s of GB) CSV file of mixed text/numbers, what is the fastest way to create an HDF5 file with the same content, while keeping the memory usage reasonable? I'd like to use the h5py module if possible. In the toy example below, I've…
Nicholas Palko
  • 813
  • 3
  • 11
  • 21
24
votes
2 answers

hdf5 / h5py ImportError: libhdf5.so.7

I'm working on a project involving network messaging queues (msgpack, zmq, ...) on a RHEL 6.3 (x86_64) system. I was installing the most recent packages of glib, gevent, pygobject, pygtk, and such in order to get pylab / matplotlib to work (which…
cronburg
  • 892
  • 1
  • 8
  • 24
23
votes
2 answers

HDF5 file created with h5py can't be opened by h5py

I created an HDF5 file apparently without any problems, under Ubuntu 12.04 (32bit version), using Anaconda as Python distribution and writing in ipython notebooks. The underlying data are all numpy arrays. For example, import numpy as np import…
Lilith-Elina
  • 1,613
  • 4
  • 20
  • 31
22
votes
3 answers

Close an open h5py data file

In our lab we store our data in hdf5 files trough the python package h5py. At the beginning of an experiment we create an hdf5 file and store array after array of array of data in the file (among other things). When an experiment fails or is…
Adriaan Rol
  • 420
  • 2
  • 4
  • 12
20
votes
8 answers

Save Keras ModelCheckpoints in Google Cloud Bucket

I'm working on training a LSTM network on Google Cloud Machine Learning Engine using Keras with TensorFlow backend. I managed it to deploy my model and perform a successful training task after some adjustments to the gcloud and my python script. I…
Kevin Katzke
  • 3,581
  • 3
  • 38
  • 47
20
votes
5 answers

How to differentiate between HDF5 datasets and groups with h5py?

I use the Python package h5py (version 2.5.0) to access my hdf5 files. I want to traverse the content of a file and do something with every dataset. Using the visit method: import h5py def print_it(name): dset = f[name] print(dset) …
NoDataDumpNoContribution
  • 10,591
  • 9
  • 64
  • 104
20
votes
1 answer

How to partially copy using python an Hdf5 file into a new one keeping the same structure?

I have a large hdf5 file that looks something like this: A/B/dataset1, dataset2 A/C/dataset1, dataset2 A/D/dataset1, dataset2 A/E/dataset1, dataset2 ... I want to create a new file with only that: A/B/dataset1, dataset2 A/C/dataset1, dataset2 What…
graham
  • 335
  • 1
  • 3
  • 10
19
votes
3 answers

'/' in names in HDF5 files confusion

I am experiencing some really weird interactions between h5py, PyTables (via Pandas), and C++ generated HDF5 files. It seems that, h5check and h5py seem to cope with type names containing '/' but pandas/PyTables cannot. Clearly, there is a gap in my…
Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156
19
votes
3 answers

How convert this type of data to something more readable in the python?

I have quite big dataset. All information stored in the hdf5 format file. I found h5py library for python. All works properly except of the [] I have no idea how to convert it in something more readable. Can I do it at all ?…
Dmytro Chasovskyi
  • 3,209
  • 4
  • 40
  • 82
18
votes
3 answers

How do I traverse a hdf5 file using h5py

How do I traverse all the groups and datasets of an hdf5 file using h5py? I want to retrieve all the contents of the file from a common root using a for loop or something similar.
Marcio
  • 597
  • 4
  • 7
  • 16
18
votes
3 answers

h5py: Correct way to slice array datasets

I'm a bit confused here: As far as I have understood, h5py's .value method reads an entire dataset and dumps it into an array, which is slow and discouraged (and should be generally replaced by [()]. The correct way is to use numpy-esque…
JiaYow
  • 5,207
  • 3
  • 32
  • 36
18
votes
6 answers

How to read a v7.3 mat file via h5py?

I have a struct array created by matlab and stored in v7.3 format mat file: struArray = struct('name', {'one', 'two', 'three'}, 'id', {1,2,3}, 'data', {[1:10], [3:9], [0]}) save('test.mat', 'struArray',…
Eastsun
  • 18,526
  • 6
  • 57
  • 81
1
2
3
86 87