General Utils

Library for general utils, such as dataframe properties checking, creating directories, checking files, etc.

prokbert.general_utils.check_expected_columns(df, ...)

Checks if a DataFrame contains the expected columns.

prokbert.general_utils.is_valid_primary_key(df, ...)

Checks if a specified column in a DataFrame can serve as a valid primary key.

prokbert.general_utils.get_non_empty_files(...)

Generator that yields non-empty files from a specified directory and its subdirectories based on the given extensions.

prokbert.general_utils.truncate_zero_columns(arr)

Truncate all trailing columns composed entirely of zeros in a given 2D numpy array.

prokbert.general_utils.create_directory_for_filepath(...)

Given a file path, creates the underlying directory structure if it doesn't already exist.

prokbert.general_utils.check_file_exists(...)

Checks if the provided file path exists.