isaricanalytics.utils

isaricanalytics.utils.clean_figure_table(figure_table: DataFrame) DataFrame[source]

pandas.DataFrame : A cleaned figure table dataframe.

The cleaning steps are unique to the Plotly graph object table format from which the table CSVs were originally, which contain HTML styling elements and non-standard (non-alphabetic) Unicode characters. The cleaning is the removal of such characters.

Parameters:
figure_tablepandas.DataFrame

The original figure table as a Pandas dataframe.

Returns:
pandas.DataFrame

The cleaned figure table.

isaricanalytics.utils.strip_html(value: Any) str | Any[source]

typing.Any : Strip HTML elements from a value.

Parameters:
valuetyping.Any

A value.

Returns:
str, typing.Any

Either a string stripped of all HTML elements, or the original non- string value.

isaricanalytics.utils.strip_nonstandard_unicode_chars(value: Any) str | Any[source]

typing.Any : Strip non-standard Unicode characters from a value.

The non-standard Unicode characters of interest are defined within the function itself, and are currently limited to the “↳” (U+21B3) character, but may be extended to include other characters.

Parameters:
valuetyping.Any

A value.

Returns:
str, typing.Any

Either a string stripped of all non-standard Unicode characters, or the original non- string value.