asi_core.visualization.timeseries

This module provides functions to visualize timeseries data.

Functions

heatmap_missing_data(missing_timestamps[, start_date, ...])

Generate a heatmap displaying the distribution of missing data over time.

plot_data_distributions(df, columns, n_rows[, df_ref, ...])

Plot histogram of data in subplots.

Module Contents

asi_core.visualization.timeseries.heatmap_missing_data(missing_timestamps, start_date=None, end_date=None, hour_min=6, hour_max=20, y_dim='hour', x_dim='date', title=None, interactive=False)

Generate a heatmap displaying the distribution of missing data over time.

Parameters:
  • missing_timestamps (pandas.Series) – A pandas Series of timestamps representing missing data occurrences.

  • start_date (str or datetime, optional) – The start of the time range for the heatmap. Defaults to the earliest timestamp in missing_timestamps.

  • end_date (str or datetime, optional) – The end of the time range for the heatmap. Defaults to the latest timestamp in missing_timestamps.

  • hour_min (int, optional) – The minimum hour of the day to include in the heatmap (default is 6).

  • hour_max (int, optional) – The maximum hour of the day to include in the heatmap (default is 20).

  • y_dim (str, optional) – The variable to use for the y-axis (default is ‘hour’).

  • x_dim (str, optional) – The variable to use for the x-axis (default is ‘date’).

  • title (str, optional) – The title of the heatmap. Defaults to ‘Heatmap of Missing Data’.

  • interactive (bool, optional) – If True, generates an interactive heatmap using hvplot; otherwise, generates a static heatmap using seaborn.

Returns:

A heatmap figure displaying missing data patterns over time.

Return type:

matplotlib.figure.Figure or holoviews.element.HeatMap

asi_core.visualization.timeseries.plot_data_distributions(df, columns, n_rows, df_ref=None, figsize=(20, 12), title=None)

Plot histogram of data in subplots.

Parameters:
  • df – dataframe containing timeseries data.

  • columns – list of column names.

  • n_rows – number of rows in figure.

  • df_ref – reference dataframe (requires the same columns).

  • figsize – figure size.

  • title – title of figure.

Returns:

figure object.