Skip to main content

lite weight data frame class that supports nestes structures.

Project description

Project generated with PyScaffold

BiocFrame

This package implements a lite weight data frame like class (comparable to Pandas DataFrame) but supports more flexible column types, e.g: nested columns.

Install

Package is published to PyPI

pip install biocframe

Usage

Lets create a BiocFrame from a dictionary

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.columnNames)

Setters

Using the Pythonic way to set properties

# set new column names
bframe.columnNames = [... new colnames ...]
print(bframe.columnNames)

# 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.3. 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.2.16.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

BiocFrame-0.2.16-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for BiocFrame-0.2.16.tar.gz
Algorithm Hash digest
SHA256 702474cbc53c01aeb5a38415623943e3ecd6273dcc23d0482817a6709af22862
MD5 6b10e7565a1523a77c1a845051feff2e
BLAKE2b-256 d1652656e01c04ef00363b87982876f3f4cd4fc3d3810cf9362b1adbe1f372aa

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for BiocFrame-0.2.16-py3-none-any.whl
Algorithm Hash digest
SHA256 3505d96f9d48481dbcd9662e2d65fe60f99b592afd55d2fc7d2656353f492c0d
MD5 766024b7106b861faf3b56c31520c556
BLAKE2b-256 215c61068b84b19079c536270ab43ab452eca173587bb3a253ca0da8cd6e0f84

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