Befordata: A Python package for behavioural force data
Project description
BeForData: A Python package for behavioural force data
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
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.zero_sample: Sample index representing the sample of the time zero within each epoch (default: 0).baseline(optional): 1D numpy array containing baseline values for each epoch atzero_sample.meta(optional): Arbitrary metadata associated with the epochs.
Typical Workflow
- Load raw force data into a BeForRecord object.
- Preprocess and annotate the data as needed.
- Segment the data into epochs using event markers, creating a BeForEpochs object.
Install via pip
pip install befordata
Citation
If you use befordata in your research, please cite it as:
Lindemann, O. (2025). BeForData: A Python package for behavioural response force
data. [Computer software]. https://pypi.org/project/befordata/
Or in BibTeX:
@software{pybefordata2025,
author = {Lindemann, Oliver},
title = {{BeForData}: A {Python} package for behavioural force data},
year = {2025},
url = {https://pypi.org/project/befordata/}
version = {0.4}
}
Julia
A Julia implementation of BeForData is available as a beta release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file befordata-0.4.8.tar.gz.
File metadata
- Download URL: befordata-0.4.8.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abb0faa669d1694ba7e9de8f881edf749e248fab50672546a3e642473b49f22d
|
|
| MD5 |
61d82b089fc11d014eec0a8e485b79b7
|
|
| BLAKE2b-256 |
7efa667ef7536845630e701fb76ec4d83548c1149086b9b2ebe7132e56fc12da
|
File details
Details for the file befordata-0.4.8-py3-none-any.whl.
File metadata
- Download URL: befordata-0.4.8-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22687198406b39b1717fff30a729884f670b0c3186e528a4a0246fc41f73f6d4
|
|
| MD5 |
93e7806cf4fd00dcf32a9b117b0619d6
|
|
| BLAKE2b-256 |
2c4db87c4263f05795451426e937250e2f08b0f85d5066e568cf47285e5f64d0
|