Skip to main content

lite-data frame representation that supports nestes structures.

Project description

Project generated with PyScaffold PyPI-Server Unit tests

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BiocFrame-0.3.8.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

BiocFrame-0.3.8-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file BiocFrame-0.3.8.tar.gz.

File metadata

  • Download URL: BiocFrame-0.3.8.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for BiocFrame-0.3.8.tar.gz
Algorithm Hash digest
SHA256 62ee26087a5cea39719777a6fc6e37e78753528bb5d1d6a376ff7d9055d949d7
MD5 c1df3a778df3bd77620b287e0cde423e
BLAKE2b-256 d41359df7336ed040ba34c22ba80fa5feac0be15c2d5344ea8416a35d89e659b

See more details on using hashes here.

File details

Details for the file BiocFrame-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: BiocFrame-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for BiocFrame-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 26b70be0dccd1e4962c4561b7eeeaea0474a67441d3952bcbcb8907fd12cc022
MD5 6e01136315f8a11a31e4992f438d9623
BLAKE2b-256 9c27b4da0c45cb6ca81dae48af138df5085fcbea3d364b9df9fe5b4bfec0d6a8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page