Skip to main content

Utilities to use across the biocpy packages.

Project description

Utilities for BiocPy

Project generated with PyScaffold PyPI-Server Monthly Downloads Unit tests

Motivation

This repository contains a variety of simple utilities for the BiocPy project, mostly convenient aspects of R that aren't provided by base Python. The aim is to simplify development of higher-level packages like scranpy and singler that would otherwise have to implement these methods individually.

Available utilities

match

import biocutils
biocutils.match(["A", "C", "E"], ["A", "B", "C", "D", "E"])
## [0, 2, 4]

factor

import biocutils
biocutils.factor(["A", "B", "B", "A", "C", "D", "C", "D"])
## (['A', 'B', 'C', 'D'], [0, 1, 1, 0, 2, 3, 2, 3])

intersect

import biocutils
biocutils.intersect(["A", "B", "C", "D"], ["D", "A", "E"])
## ['A', 'D']

union

import biocutils
biocutils.union(["A", "B", "C", "D"], ["D", "A", "E"])
## ['A', 'B', 'C', 'D', 'E']

subset

import biocutils
biocutils.subset(["A", "B", "C", "D", "E"], [0, 2, 4])
## ['A', 'C', 'E']

import numpy as np
y = np.array([10, 20, 30, 40, 50])
biocutils.subset(y, [0, 2, 4])
## array([10, 30, 50])

is_list_of_type

Checks if all elements of a list or tuple are of the same type.

import biocutils
import numpy as np

x = [np.random.rand(3), np.random.rand(3, 2)]
biocutils.is_list_of_type(x, np.ndarray)
## True

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

biocutils-0.1.6.tar.gz (57.9 kB view details)

Uploaded Source

Built Distribution

biocutils-0.1.6-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

File details

Details for the file biocutils-0.1.6.tar.gz.

File metadata

  • Download URL: biocutils-0.1.6.tar.gz
  • Upload date:
  • Size: 57.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for biocutils-0.1.6.tar.gz
Algorithm Hash digest
SHA256 7fb2789ae4e5fac57f5da5894fff6eae33f4684a4b888fe893f703a45678c3ce
MD5 8e7db95fca69afe762e52836546ecb1c
BLAKE2b-256 868b8e00e2ea4a2e25642e0d6105798a72bd9586d5a979ff38be00bf3fad8f0f

See more details on using hashes here.

File details

Details for the file biocutils-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: biocutils-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 45.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for biocutils-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4409d722df8d2ba711c37ed0422755a65036c22880bd80e62cceb23ba81de5b4
MD5 35ab1fa2b437d9b94b9cf83a59f2e07d
BLAKE2b-256 5c641e544efee5bdb8ec8cacc51c05904e8c707ecec87d97206c7ed8a940ebba

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