ops¶
Miscellaneous operations.
General usage¶
|
Prompts user for confirmation to proceed. |
|
Retrieves main attributes of an object. |
|
Converts a string representation to its intrinsic data type. |
|
Hashes a password using hashlib.pbkdf2_hmac (PBKDF2 algorithm with HMAC-SHA256). |
|
Verifies if a password matches the provided salt and key. |
|
Decorator to measure the execution time of a function or class method. |
Basic computation / conversion¶
|
Retrieves the difference between UTC (Coordinated Universal Time) and TAI (International Atomic Time). |
|
Converts GPS time to UTC time. |
|
Parses size into human-readable format or vice versa. |
|
Gets the total number of chunks of a data file, given a minimum chunk size limit. |
|
Gets the upper and lower bounds for extreme outliers using the interquartile range method. |
|
Calculates the interquartile range (IQR) of numerical data. |
|
Finds the closest date to a given date from a list of dates. |
Basic data manipulation¶
Iterable
|
Generates pairs of consecutive elements from the given iterable. |
|
Splits a list into evenly sized sub-lists. |
|
Splits a list into a specified number of equally-sized sub-lists. |
|
Splits an iterable into evenly sized chunks. |
|
Updates a (nested) dictionary with another dictionary. |
|
Updates keys in a (nested) dictionary based on a given replacements dictionary. |
|
Retrieves all values in a (nested) dictionary for a given key. |
|
Removes multiple keys from a dictionary. |
|
Compares the differences between two dictionaries. |
|
Merges multiple dictionaries into a single dictionary. |
Tabular data
|
Detects if a column with string type contains |
|
Creates a 2D rotation matrix for counterclockwise rotation. |
|
Converts a dictionary to a dataframe. |
|
Swaps positions of two columns in an array. |
|
Swaps positions of two rows in an array. |
|
Shifts an array by a desired number of rows. |
|
Creates a discrete colour ramp. |
|
Creates a colour bar with correctly aligned labels. |
Graph plotting
|
Creates a discrete colour ramp. |
|
Creates a colour bar with correctly aligned labels. |
Web data manipulation¶
Checks whether the current machine is connected to the Internet. |
|
|
Checks if |
|
Checks if the current machine can connect to the given URL. |
|
Checks if a URL leads to a webpage where downloadable content is available. |
|
Instantiates a requests session with configurable retry behaviour. |
|
Loads user-agent strings for popular web browsers. |
|
Gets a random user-agent string for a specified browser. |
|
Generates fake HTTP headers. |
|
Downloads a file from a valid URL. |
|
Downloads files from GitHub repositories. |