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.factorize(["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

and many more. Check out the documentation for more information.

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.3.2.dev1.tar.gz (63.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

biocutils-0.3.2.dev1-py3-none-any.whl (49.7 kB view details)

Uploaded Python 3

File details

Details for the file biocutils-0.3.2.dev1.tar.gz.

File metadata

  • Download URL: biocutils-0.3.2.dev1.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for biocutils-0.3.2.dev1.tar.gz
Algorithm Hash digest
SHA256 3cb4141aaae3c3d74d489f84702b138afc7809652d5af487e4680832e1f277bf
MD5 3bc22978b3e59cb4d5b93593d17a03e2
BLAKE2b-256 d836e89155ff064d8612214f66d0519fdd0348f4f0db3454854240c29cc7f03a

See more details on using hashes here.

Provenance

The following attestation bundles were made for biocutils-0.3.2.dev1.tar.gz:

Publisher: publish-pypi.yml on BiocPy/BiocUtils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biocutils-0.3.2.dev1-py3-none-any.whl.

File metadata

  • Download URL: biocutils-0.3.2.dev1-py3-none-any.whl
  • Upload date:
  • Size: 49.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for biocutils-0.3.2.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 7b34b7d29590c882275b1b5f4daa2f588e3445078768ed0c43795bb019edf077
MD5 419b1a86576c35ec544054945f0baba3
BLAKE2b-256 71f2d59c6a769f851b84bebd7f51881d09b5b2ad6fc82f0efe8c7b4c71bf91ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for biocutils-0.3.2.dev1-py3-none-any.whl:

Publisher: publish-pypi.yml on BiocPy/BiocUtils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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