ops¶
Miscellaneous operations.
General usage¶
|
Prompt user for confirmation to proceed. |
|
Retrieve main attributes of an object. |
|
Convert a string representation to its intrinsic data type. |
|
Hash a password using hashlib.pbkdf2_hmac (PBKDF2 algorithm with HMAC-SHA256). |
|
Verify if a password matches the provided salt and key. |
|
Decorator to measure the execution time of a function or class method. |
Basic computation / conversion¶
|
Convert GPS time to UTC time. |
|
Parse size into human-readable format or vice versa. |
|
Get the total number of chunks of a data file, given a minimum chunk size limit. |
|
Get the upper and lower bounds for extreme outliers using the interquartile range method. |
|
Calculate the interquartile range (IQR) of numerical data. |
|
Find the closest date to a given date from a list of dates. |
Basic data manipulation¶
Iterable
|
Generate pairs of consecutive elements from the given iterable. |
|
Split a list into evenly sized sub-lists. |
|
Split a list into a specified number of equally-sized sub-lists. |
|
Split an iterable into evenly sized chunks. |
|
Update a (nested) dictionary with another dictionary. |
|
Update keys in a (nested) dictionary based on a given replacements dictionary. |
|
Retrieve all values in a (nested) dictionary for a given key. |
|
Remove multiple keys from a dictionary. |
|
Compare the differences between two dictionaries. |
|
Merge multiple dictionaries into a single dictionary. |
Tabular data
|
Detect if a column with string type contains |
|
Create a 2D rotation matrix for counterclockwise rotation. |
|
Convert a dictionary to a dataframe. |
|
Load in a compressed sparse row (CSR) or compressed row storage (CRS). |
|
Swap positions of two columns in an array. |
|
Swap positions of two rows in an array. |
|
Shift an array by a desired number of rows. |
|
Create a discrete colour ramp. |
|
Create a colour bar with correctly aligned labels. |
Graph plotting
|
Create a discrete colour ramp. |
|
Create a colour bar with correctly aligned labels. |
Web data manipulation¶
Check whether the current machine is connected to the Internet. |
|
|
Check if |
|
Check if the current machine can connect to the given URL. |
|
Check if a URL leads to a webpage where downloadable content is available. |
|
Instantiate a requests session with configurable retry behaviour. |
|
Load user-agent strings for popular web browsers. |
|
Get a random user-agent string for a specified browser. |
|
Generate fake HTTP headers for requests.get. |
|
Download a file from a valid URL. |
|
Download files from GitHub repositories. |