maad.util.heatmap_by_date_and_time

maad.util.heatmap_by_date_and_time(dataframe, disp_column, date_format='%V', date_range=[1, 53], time_resolution='30T', time_range=['00:00', '23:59'], start_hour='00:00', full_display=False, date_min_to_disp=1, date_max_to_disp=53, cb_legend='', display=True, verbose=False, **kwargs)[source]

Plot a heatmap of a features by time (x-axis) and date (y-axis).

Parameters:
dataframepandas.DataFrame

The input DataFrame containing the data. Must contain a column (or index) date in the format %Y-%m-%d %H:%M%S

disp_columnstr

The name of the column to be displayed.

date_formatstr, optional

The format of the date. The default is “%V”. (See https://docs.python.org/3/library/datetime.html for format codes) Possible format are : - “%V” for week number (from 1 to 53) - “%m” for Month (from 1 to 12) - “%d” for Day (from 1 to 31 depending on the month) - “%m-%d” for Date without year (from 01-01 to 12-31) - “%y-%m-%d” for Date with year

date_rangelist of int, optional

The range of date types to include. The default is [1, 53]. The format of the range depends on date_format. For instance, to get all the samples in the March, date_range would be [03-01, 03-31] and date_format would be “%m-%d”

time_resolutionstr, optional

The time resolution. The default is “30T”. T is for minute. 30T means a time resolution of 30 min. Everything within this intervale is averaged Other time formats are H for hour and D for day.

time_rangelist of str, optional

The time range to consider. The default is [“00:00”, “23:59”].

start_hourstr, optional

The start hour. The default is “12:00”.

full_displaybool, optional

Whether to display the full date range. The default is False.

date_min_to_dispint, optional

The minimum date on the y-axis. The default is 1. The value depends on the date_format. See date_format to know the possible formats and the range of possible values

date_max_to_dispint, optional

The maximum date on the y-axis. The default is 53. The value depends on the date_format. See date_format to know the possible formats and the range of possible values

cb_legendstr, optional

The colorbar legend label. The default is “”.

verbosebool, optional

If True, display verbose information. The default is False.

**kwargs

Specific to this function:

Specific to matplotlib:

  • figsize : tuple of integers, optional, default: (4,10) width, height in inches.

  • title : string, optional, default : ‘Spectrogram’ title of the figure

  • xlabel : string, optional, default : ‘Time [s]’ label of the horizontal axis

  • ylabel : string, optional, default : ‘Amplitude [AU]’ label of the vertical axis

  • xtickstuple of ndarrays, optional, defaultnone
    • ticks : array_like => A list of positions at which ticks should be placed. You can pass an empty list to disable yticks.

    • labels : array_like, optional => A list of explicit labels to place at the given locs.

  • ytickstuple of ndarrays, optional, defaultnone
    • ticks : array_like => A list of positions at which ticks should be placed. You can pass an empty list to disable yticks.

    • labels : array_like, optional => A list of explicit labels to place at the given locs.

  • cmapstring or Colormap object, optional, default is ‘gray’

    See https://matplotlib.org/examples/color/colormaps_reference.html in order to get all the existing colormaps examples: ‘hsv’, ‘hot’, ‘bone’, ‘tab20c’, ‘jet’, ‘seismic’, ‘viridis’…

  • vmin, vmaxscalar, optional, default: None

    vmin and vmax are used in conjunction with norm to normalize luminance data. Note if you pass a norm instance, your settings for vmin and vmax will be ignored.

  • extentlist of scalars [left, right, bottom, top], optional, default: None

    The location, in data-coordinates, of the lower-left and upper-right corners. If None, the image is positioned such that the pixel centers fall on zero-based (row, column) indices.

  • nowboolean, optional, defaultTrue

    if True, display now. Cannot display multiple images. To display mutliple images, set now=False until the last call for the last image

… and more, see matplotlib

Returns:
df_meanpd.DataFrame

The heatmap with mean values.

df_std :pd.DataFrame

The heatmap with standard deviation values.

figmatplotlib.figure.Figure

The generated matplotlib figure.

axmatplotlib.axes.Axes

The generated matplotlib axis.