tacco.utils.merge_colors

merge_colors(colors, mapping)[source]

Merges a dict-like of colors into coarser colors.

Parameters:
  • colors – A dict-like with numeric colors as values.

  • mapping – A mapping from coarse to a list-like of (or a single) fine annotation categories as dict, Series, etc. or anything else with a .items method. The fine annotation categories which are not given coarse annotation categories are left unchanged.

Returns:

Returns the merged colors as a Series.