lite-data frame representation that supports nestes structures.
Project description
BiocFrame
This package provides a data frame representation similar to a pandas DataFrame
, with
support for nested column types.
Install
Package is published to PyPI
pip install biocframe
Usage
Lets create a BiocFrame
from a dictionary
from random import random
from biocframe import BiocFrame
bframe = BiocFrame(
data = {
"seqnames": [
"chr1",
"chr2",
"chr2",
"chr2",
"chr1",
"chr1",
"chr3",
"chr3",
"chr3",
"chr3",
]
* 20,
"starts": range(100, 300),
"ends": range(110, 310),
"strand": ["-", "+", "+", "*", "*", "+", "+", "+", "-", "-"] * 20,
"score": range(0, 200),
"GC": [random() for _ in range(10)] * 20,
}
)
Access Properties
Accessor methods/properties are available to access column names, row names and dims.
# find the dimensions
print(bframe.dims)
# get the column names
print(bframe.column_names)
Setters
Using the Pythonic way to set properties
# set new column names
bframe.column_names = [..., new_column_names, ...]
print(bframe.column_names)
# add or reassign columns
bframe["score"] = range(200, 400)
Slice the BiocFrame
Currently slicing is only supported by indices or names (column names or row names). A future version may implement pandas query-like operations.
sliced_bframe = bframe[3:7, 2:5]
For more use cases including subset, checkout the documentation
Note
This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.
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
Hashes for BiocFrame-0.3.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be99710652e588a847af24db18d66969c50c38f9423380874bf7d85179666467 |
|
MD5 | 4cab302fdad9699615fda6ff7e0bb3dd |
|
BLAKE2b-256 | ce9ab6e61dfb4047f45b3eb9f5c0b0a077236a6ef4e0c481e7c0605eaac16740 |