Skip to main content

scipy.sparse support on h5py

Project description

h5max

A utility package built upon h5py for easier data saving and loading of sparse data objects.

PyPi Version GitHub license GitHub issues GitHub stars

h5max handles storing and loading of scipy.sparse data structures in h5py file objects, which is not natively supported. It assumes a simple data structure where information of individual samples are stored according to the index they occupy within datasets.

🔗 Installation

pip install h5max

📖 User guide

import h5py
import h5max
import numpy as np

fh = h5py.File('my_data.h5', 'w')

a = np.zeros((100,100))
b = np.zeros((1000,50))
a[7,1] = 1
b[1,0] = 10

m_list = [a, b]

# store both a, b
h5max.store_sparse(fh, m_list, format='csr')

# load only a (index 0)
a_out = h5max.load_sparse(fh, 0, format='csr')

# load [a,b]
m_list_out = h5max.load_sparse(fh, [0, 1], format='csr', to_numpy=True)

# load all idxs in the data
m_list_out = h5max.load_sparse(fh, format='csr')

fh.close()

✔️ Package features

  • Support for csr, csc, coo sparse types
  • Support for bsr, dia, dok, lil sparse types
  • Support for overwriting
  • Flexible data loading and saving (both as sparse and numpy arrays.)
  • Automatic format detection

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

h5max-0.3.4.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

h5max-0.3.4-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file h5max-0.3.4.tar.gz.

File metadata

  • Download URL: h5max-0.3.4.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for h5max-0.3.4.tar.gz
Algorithm Hash digest
SHA256 0cef2a58fafd4673f7745df0f3d043a6cd200cd4735e923d5ce3731c90675b6b
MD5 358d9ae8bc50f15f86bbc767ef80cb4b
BLAKE2b-256 2ac7d9a915bc3f364ca239b3f7af6972e208098c0f225d49145ffef9e6b3e4c2

See more details on using hashes here.

File details

Details for the file h5max-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: h5max-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for h5max-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 15ebe3e2a34f9ebf87002c7f0dd8ac7072d3b5ff819b32b4d9ac3c8b658ae5eb
MD5 da4b0fa35cb0089ab7201e5ddd9a9f79
BLAKE2b-256 66e150ea30b16a2d18f0e78c07a6aa00e35bd8029930aa61da8c2360b82678e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page