Skip to main content

A Python package for handling data arrays with axis labels

Project description

Labelled-Data-Array

Is a package for handling N-dimensional numerical data arrays with labels. This is simply a wrapper numpy wrapper with labels management and some data selection and casting support.

It is important to note that all the labels for a single axis need to be unique!

Example

Given N ground motion recording stations, M different intensity measures, K different realisations, a LabelledDataArray allows for easily handling of this data while also keeping track of associated lables.

import numpy as np
import labelled_data_array as lda

stations = ["ACB", "DSF", "GHI", "JKL"]
ims = ["PGA", "PGV"]
rels = ["REL01", "REL02", "REL03", "REL04"]

# Generate some random data
data = np.random.rand(len(stations), len(ims), len(rels))

# Creation of a LabelledDataArray
im_data = lda.LabelledDataArray(data, axis_labels=[stations, ims, rels])

# Numpy indexing is supported
print(im_data[0, :, :])

### Data selection by axis value(s) ###

# E.g. select all IM values for station "ACB"
# 2D output is returned as a DataFrame
print(im_data.sel["ACB", :, :])

# Select all values for station "ACB" and IM "PGA"
# 1D output is returned as a Series
print(im_data.sel["ACB", "PGA", :])

# Get the scalar value for station "ACB", IM "PGA" and REL "REL01"
print(im_data.sel["ACB", "PGA", "REL01"])

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

labelled_data_array-2025.12.2.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

labelled_data_array-2025.12.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file labelled_data_array-2025.12.2.tar.gz.

File metadata

  • Download URL: labelled_data_array-2025.12.2.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for labelled_data_array-2025.12.2.tar.gz
Algorithm Hash digest
SHA256 f029d5b5b2d5abf220432916afa1c003e16adca1774cfc4b3cf69bf475fa13ee
MD5 03d0746d967b1de3f7bc48255b6f548e
BLAKE2b-256 975180ce796a926a8fb058573b63e8872e31b041272af0cdfb5a056e24db453e

See more details on using hashes here.

Provenance

The following attestation bundles were made for labelled_data_array-2025.12.2.tar.gz:

Publisher: publish-PyPI.yml on claudio525/labelled-data-array

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file labelled_data_array-2025.12.2-py3-none-any.whl.

File metadata

File hashes

Hashes for labelled_data_array-2025.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e2a9ae36cced696f358153a19eb42cf27ba8be2f9e5d8fce724d5515dce1349c
MD5 752db6745519591671ee413b72169d27
BLAKE2b-256 b5c4d38f294a3fa1901ef1c4344fbae2f2cd0f5984de1880faa11960a8e63e17

See more details on using hashes here.

Provenance

The following attestation bundles were made for labelled_data_array-2025.12.2-py3-none-any.whl:

Publisher: publish-PyPI.yml on claudio525/labelled-data-array

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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