Utilities to use across the biocpy packages.
Project description
Utilities for BiocPy
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
Release history Release notifications | RSS feed
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.4.tar.gz
(54.8 kB
view hashes)
Built Distribution
biocutils-0.1.4-py3-none-any.whl
(41.6 kB
view hashes)
Close
Hashes for biocutils-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0ea4f7d9d6dcc61b5536d5053be70336f5d9ff1c496e1b903cd8ad2d9acd2e8 |
|
MD5 | a04df65b2f8a673d9c0a26e23750bf44 |
|
BLAKE2b-256 | 07cefbf0d8f1075e88bb9ae78eb1ad71c51a3bc5973925d904b118c14508ca69 |