src.toolbox.utils.time#
Functions#
|
Safely compute the median of datetime64[ns] array using pandas. |
|
Add a secondary datetime x-axis (on top) that mirrors the main x-axis ticks and labels. |
Module Contents#
- src.toolbox.utils.time.safe_median_datetime(x: numpy.ndarray, axis=None, **kwargs) numpy.datetime64[source]#
Safely compute the median of datetime64[ns] array using pandas.
- Parameters:
x (np.ndarray) – A 1D array of datetime64 values.
- Returns:
Median datetime or NaT if input is empty/all-NaT.
- Return type:
np.datetime64