spac.data_utils.append_annotation(data: DataFrame, annotation: dict) DataFrame[source]

Append a new annotation with single value to a Pandas DataFrame based on mapping rules.

Parameters:
  • data (pd.DataFrame) – The input DataFrame to which the new observation will be appended.

  • annotation (dict) – dictionary of string pairs representing the new annotation and its value. Each pair should have this format: <new annotation column name>:<value of the annotation> The values must be a single string or numeric value.

Returns:

The DataFrame with the new observation appended.

Return type:

pd.DataFrame