(data, root_location=None, location_stack=None, n_top_examples=40, return_df=False, show=True)


Shows the location stack as a sankey chart per element for the selected root location. It shows the different elements by type and id as nodes from left to right. The size of the nodes and links indicate the number of events that have this location element or these location element combinations.


  • data (bach.dataframe.DataFrame) – bach.DataFrame to apply the method on.
  • root_location (Optional[str]) – the name of the root location to use for visualization of the location stack. If None, it will use the most common root location in the data.
  • location_stack (Optional[Union[str, modelhub.series.series_objectiv.SeriesLocationStack]]) – the column of which to create the paths. Can be a string of the name of a SeriesLocationStack type column, or a Series with the same base node as data. If None the default location stack is taken.
  • n_top_examples – number of top examples from the location stack to plot (if we have too many examples to plot it can slow down the browser).
  • return_df (bool) – returns a bach.DataFrame with the data from which the sankey diagram is created.
  • show (bool) – if True, it shows the plot, if False it only returns the DataFrame with the data that is to be plotted.


None or DataFrame