Reference¶
Constants¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
Built-in immutable sequence. |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
Built-in immutable sequence. |
|
Built-in immutable sequence. |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
Math and statistics¶
Compute the Euclidean distance between two vectors. |
|
Convert fold change to log ratio. |
|
Compute the geometric mean. |
|
Return (and print) the first and last n elements / rows. |
|
Return the intersection of multiple sequences. |
|
Build a Boolean intersection matrix. |
|
Convert log ratio to fold change. |
|
Rank values within each column, with ties averaged. |
|
Compute the standard error of the mean. |
|
Compute Z-scores (column-wise for matrices). |
Data manipulation¶
Return duplicated elements. |
|
Keep only columns that contain scalar (atomic) values. |
|
Return indices of all matches of x in table. |
|
Recursively search for x in a nested dict/list structure. |
|
Return elements that appear exactly once. |
String utilities¶
Extract first match of pattern from string. |
|
Return all matches of pattern in string. |
|
Return the first regex match object of pattern in string. |
|
Return all regex match objects for pattern in string. |
|
Pad a string to a minimum width. |
|
Remove empty strings and None values from a list. |
|
Replace None values with a placeholder string. |
|
Split string by a regex pattern. |
|
Coerce an object to a human-friendly print string. |
|
Truncate string to n characters, appending '...' if needed. |
File and path utilities¶
Return the file basename without extension(s). |
|
Compress a file. |
|
Decompress a file. |
|
Return the directory depth of path. |
|
Return the file extension(s) including compression suffix. |
|
Create a directory (and parents) if it does not exist. |
|
Return the n-th parent directory of path. |
|
Return the n-th parent directory of path. |
|
Resolve path to an absolute real path. |
|
Create a unique temporary directory. |
|
Delete a file or directory tree. |
Path string manipulation¶
Append new_path to the end of a path string (if not present). |
|
Prepend new_path to the start of a path string (if not present). |
|
Join paths into a single colon-separated string. |
|
Remove target from a path string. |
|
Split a colon-separated path string. |
|
Remove duplicate entries from a path string. |
System utilities¶
Return available CPU count, capped at n if requested. |
|
Return the name of the current Git branch. |
|
Return the default branch name of the Git repository. |
|
Suppress console output and warnings within a block. |
|
Return total system RAM in gibibytes (GiB). |
|
Generate a random alphanumeric string of length n. |
|
Run a shell command. |
Version utilities¶
Return |
|
Return the major component of a version string. |
|
Return |
|
Normalise a version string using PEP 440. |
Download and URL¶
Download a file from url. |
|
Join URL parts with |
Display and cache helpers¶
Return a formatted header line. |
|
Return a formatted summary of an object's attributes. |
|
Return the simple class name (without module path). |
|
Return (and create) a package-specific cache directory. |