util_data_processing#

dictionary manipulation#

dict_split_by_chunk(dictionary, chunk_size)

Split dictionary into a list of chunks.

dict_delete_keys(dictionary, keys)

Delete keys from dictionary.

list manipulation#

list_split_by_equal_sublist(lst, num_of_sub)

Split a list into a number of equally-sized sub-lists.

list_split_by_fixed_length(lst, fixed_length)

Split a list into sublist of the same specified length.

list_flatten_nested(nest_lst)

Flatten a nested list.

string manipulation#

str_digit_to_int(string)

Convert a string to an integer.

str_digit_to_float(string)

Convert a string to a float.

str_strip(string)

Convert all consecutive whitespace characters to ' ' (half-width whitespace), then return a copy of the string with leading and trailing whitespace removed.

dataclass manipulation#

dataclass_creation(class_name, attributes)

Dynamically creates a dataclass with the given attributes.

dataclass_from_dict(name, data)

Creates a dataclass with attributes and values based on the given dictionary.

dataclass_merge(dataclass_one, dataclass_two)

Merges two dataclasses into a single new dataclass, handling duplicate attributes.

dataclass_extend(base_dataclass, ...)

Creates a new dataclass by extending the base_dataclass with additional_attributes.

dataclass_dict_wrapper(dataclass_instance)

Wrap a dataclass instance to provide dictionary-like access.

data processing#

is_float([value])

Check if the value can be converted to float.

get_layer_boundary(df, x_col_name, y_col_name)

Get the boundary values of the target column based on the base column values.

cvt_int_to_alpha(num)

Convert an integer to an alphabet string.