Skip to main content

An extension of pandas for efficient representation of nested associated datasets.

Project description

nested-pandas

Template

PyPI Conda

GitHub Workflow Status codecov Read the Docs benchmarks

An extension of pandas for efficient representation of nested associated datasets.

Nested-Pandas extends the pandas package with tooling and support for nested dataframes packed into values of top-level dataframe columns. Pyarrow is used internally to aid in scalability and performance.

Nested-Pandas allows data like this:

pandas dataframes

To instead be represented like this:

nestedframe

Where the nested data is represented as nested dataframes:

   # Each row of "object_nf" now has it's own sub-dataframe of matched rows from "source_df"
   object_nf.loc[0]["nested_sources"]

sub-dataframe

Allowing powerful and straightforward operations, like:

   # Compute the mean flux for each row of "object_nf"
   import numpy as np

   def mean_flux(row):
   """Calculates the mean flux for each object"""
       return np.mean(row["nested_sources.flux"])

   object_nf.map_rows(mean_flux, output_names="mean_flux")

using reduce

Nested-Pandas is motivated by time-domain astronomy use cases, where we see typically two levels of information, information about astronomical objects and then an associated set of N measurements of those objects. Nested-Pandas offers a performant and memory-efficient package for working with these types of datasets.

Core advantages being:

  • hierarchical column access
  • efficient packing of nested information into inputs to custom user functions
  • avoiding costly groupby operations

This is a LINCC Frameworks project - find more information about LINCC Frameworks here.

Acknowledgements

This project is supported by Schmidt Sciences.

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

nested_pandas-0.6.2.tar.gz (504.6 kB view details)

Uploaded Source

Built Distribution

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

nested_pandas-0.6.2-py3-none-any.whl (73.3 kB view details)

Uploaded Python 3

File details

Details for the file nested_pandas-0.6.2.tar.gz.

File metadata

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

File hashes

Hashes for nested_pandas-0.6.2.tar.gz
Algorithm Hash digest
SHA256 9671f13102590f44997159431326e9988f1cc5252596ff78a5724281e6e3bce6
MD5 54a7893da7d857f747a259683e19bb5d
BLAKE2b-256 b52e27075d9fa64527a8ac3948a662445a65779119a56219be8e46266986b687

See more details on using hashes here.

Provenance

The following attestation bundles were made for nested_pandas-0.6.2.tar.gz:

Publisher: publish-to-pypi.yml on lincc-frameworks/nested-pandas

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

File details

Details for the file nested_pandas-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: nested_pandas-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 73.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nested_pandas-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 96aad6c8d706019911c624eb066c7b77dd3df7b591b52331fc2c18d2df70dc51
MD5 7ca46155b684a0ae286f53f83988ff57
BLAKE2b-256 a4980181f9c4b22e96ed6512db86b8756da2605b365a7c0efaa41dcfca960ccb

See more details on using hashes here.

Provenance

The following attestation bundles were made for nested_pandas-0.6.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on lincc-frameworks/nested-pandas

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