arthurai.core.util#

Functions

can_cast(cast_type, obj)

Returns True if obj can be cast to cast_type, False if not

dataframe_like_to_list_of_dicts(data)

Standardize data in a List of Dicts format (e.g.

intersection_is_non_empty(iter1, iter2)

Returns True if the two iterables share at least one element :type iter1: Iterable[Any] :param iter1: :type iter2: Iterable[Any] :param iter2: :return:

is_bool_like(obj)

Returns True if obj is a numpy or Python bool, False if not

is_date_like(obj)

Returns True if obj is a numpy or Python datetime object or a pandas Timestamp, False if not

is_float_like(obj)

Returns True if obj is a numpy or Python float, False if not

is_int_like(obj)

Returns True if obj is a numpy or Python int, False if not

is_list_like(obj)

Returns True if obj is a numpy ndarray or Python list, False if not

is_str_like(obj)

Returns True if obj is a numpy or Python String, False if not

is_valid_datetime_obj(obj)

Returns True if obj can be parsed to a valid Datetime object, False if not

retrieve_json_files(directory_path)

Checks whether a given directory and its subdirectories contain json files, if so this will return a list of the files

retrieve_parquet_files(directory_path)

Checks whether a given directory and its subdirectories contain parquet files, if so this will return a list of the files

series_to_df(data)

Converts pandas Series to DataFrame

standardize_pd_obj(data, dropna, replacedatetime)

Standardize pandas object for nans and datetimes.

update_column_in_list_of_dicts(data, ...)

Adds column_values to target_column in a list of dicts in place.

Classes

NumpyEncoder(*[, skipkeys, ensure_ascii, ...])

Special json encoder for numpy types