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.7.tar.gz (58.1 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.1.7-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: biocutils-0.1.7.tar.gz
  • Upload date:
  • Size: 58.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for biocutils-0.1.7.tar.gz
Algorithm Hash digest
SHA256 880e0ce85104c4e84df0cc14980c4a486da597d58f4d85fd5f03e857a0869868
MD5 f0dbdf71d371e447a984e9bd6e91c55c
BLAKE2b-256 ca2becbb0867f3d0c02c17f03f82d627c7fde159f335c01d1fd99fb092fda6c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: biocutils-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 45.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.21

File hashes

Hashes for biocutils-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 8ff0cbfccfb7551840dfde895ca9dc2ddb07175bf9ebe1457006a7706f84a4c1
MD5 efaf3e6e693ae53706059c204a872128
BLAKE2b-256 bced8c87ab2dcdb92518ca5bc2f281b5ff3dc25ec6719093a92b24eaa4e42981

See more details on using hashes here.

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