Skip to main content

BeForData: Python data structures for handling behavioural force data.

Project description

Behavioural Force Data (BeForData)

Data structures for handling behavioural force data

This package provides core classes and utilities for loading, processing, and analysing behavioural force data, such as those collected in experimental psychology or neuroscience. It offers a structured approach to manage epochs and records of force measurements, enabling efficient data manipulation and analysis.

BeForData is based on two structured classes of force data: one for the representation of the raw time-based force measurements in the shape of a dataframe (BeForRecord) and one for epoch-based representations as matrices (BeForEpochs).

Features

  • Flexible loading and saving of force data in common formats (e.g., CSV, XDF).
  • Efficient slicing and indexing of epochs and records for batch analysis.
  • Metadata management for experimental context, including event markers and annotations.
  • Utilities for preprocessing, such as filtering and baseline correction.
  • Integration with scientific Python libraries (NumPy, pandas) for advanced analysis.

Source code: https://github.com/lindemann09/befordata

Documentation: https://lindemann09.github.io/befordata/

(c) Oliver Lindemann

GitHub license PyPI

Data Structures

  • BeForRecord

    Represents a single continuous recording of force data, including metadata such as sampling rate, channel information, and experimental annotations. BeForRecord supports data cleaning, resampling, and extraction of epochs, and provides convenient access to raw and processed force signals.

    The data structure has the following attributes:

    • dat: DataFrame containing force measurements and optionally a time column.
    • sampling_rate: Sampling rate of the force measurements (Hz).
    • sessions: List of sample indices where new recording sessions start.
    • time_column (optional): Name of the column containing time stamps (if any).
    • meta (optional): Arbitrary metadata associated with the record.
  • BeForEpochs

    A container class for managing multiple epochs of force data. Each epoch represents a segment of continuous force measurements, typically corresponding to a trial or experimental condition. BeForEpochs provides methods for slicing, indexing, and batch-processing epochs, as well as for loading and saving epoch data from various formats.

    The data structure has the following attributes:

    • dat: 2D numpy array containing the force data (epochs x samples).
    • sampling_rate: Sampling rate of the force measurements (Hz).
    • design: DataFrame containing design/metadata for each epoch.
    • baseline (optional): 1D numpy array containing baseline values for each epoch at zero_sample.
    • zero_sample: Sample index representing the sample of the time zero within each epoch (default: 0).

Typical Workflow

  1. Load raw force data into a BeForRecord object.
  2. Preprocess and annotate the data as needed.
  3. Segment the data into epochs using event markers, creating a BeForEpochs object.

Install via pip

pip install befordata

Julia

A Julia implementation of BeForData is available as a beta release.

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

befordata-0.4.1.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

befordata-0.4.1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file befordata-0.4.1.tar.gz.

File metadata

  • Download URL: befordata-0.4.1.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for befordata-0.4.1.tar.gz
Algorithm Hash digest
SHA256 96a1e44185e09a9a229c7e33cd0baad91718f948cc13c8a40efededeee5a2ea3
MD5 5186fef4eb37b5d18b5e8524bf5a6a60
BLAKE2b-256 a47dff7b7bc3bf11e3b688abfe3a35bb9a9c4d8f475c3ca4b3e3a95a5c9620fa

See more details on using hashes here.

File details

Details for the file befordata-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: befordata-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for befordata-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9c2516cdf25d83dc4a05d241dc0b82a25118c93172273596c4f66fdd4bbe006
MD5 18f962af4a15bcf59dae15332572860b
BLAKE2b-256 87851e13c569125ea0ae1ff07e7b3b8d97c4f08e1fc90108dc26c4e668403367

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