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.0.tar.gz (62.2 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.0-py3-none-any.whl (48.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: biocutils-0.3.0.tar.gz
  • Upload date:
  • Size: 62.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for biocutils-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8b331443d7fec09c254f250adec05fd8d34653abcdcaf8fbb7dc4c107af2365f
MD5 13a2dcd03891c40313401c5c7826b0b1
BLAKE2b-256 6cf7b9e4cbdcf1223c36329f4c698b9057998acba8cc94a32ce9bb8993eb36fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: biocutils-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 48.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for biocutils-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23475258c4291cd91fd51541ff921d96eccbaf0375355eb37f6d262823888b6e
MD5 a052e8913efe6a2a4f039932c756948f
BLAKE2b-256 cfc93a1985ee38cc4f05404f67150f713824ed9ea2ae44ac32b020ffee120064

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