brightwind.analyse.analyse.time_continuity_gaps

brightwind.analyse.analyse.time_continuity_gaps(data)

Returns the start and end timestamps of missing data periods. Also days lost.

A missing data period is one where data is not available for some consecutive timestamps. This breaks time continuity of the data. The function calculates the sampling period (resolution) of the data by finding the most common time difference between consecutive timestamps. Then it searches where the time difference between consecutive timestamps does not match the sampling period, this is the missing data period. It returns a DataFrame where the first column is the starting timestamp of the missing period and the second column is the end date of the missing period. An additional column also shows how many days of data were lost in a missing period.

Parameters

data (pandas.Series or pandas.DataFrame) – Data for checking continuity, timestamp must be the index

Returns

A DataFrame with the start and end timestamps of missing gaps in the data along with the size of the gap in days lost.

Return type

pandas.DataFrame

Example usage

import brightwind as bw
data = bw.load_csv(bw.shell_flats_80m_csv)
bw.time_continuity_gaps(data['WS70mA100NW_Avg'])