(index)
Check if a time index has no gaps.

        Parameters
        ----------
        index : pd.DatetimeIndex
            Time index to be checked for gaps.

        Raises
        ------
        TypeError
            If inconvenient type.

        IndexError
            If there is a gap.
Check if a time index has no gaps.
Check if a time index has no gaps .
def check_no_gaps(index):
        """Check if a time index has no gaps.

        Parameters
        ----------
        index : pd.DatetimeIndex
            Time index to be checked for gaps.

        Raises
        ------
        TypeError
            If inconvenient type.

        IndexError
            If there is a gap.

        """
        if not isinstance(index, pd.DatetimeIndex):
            raise TypeError('Unsupported type: {}'.format(type(index)))

        correct_index = pd.date_range(index[0], periods=len(index), freq=index.freq)

        if not correct_index.equals(index):
            raise IndexError('Index has gaps.')
def check_no_gaps ( index ) : if not isinstance ( index , pd . DatetimeIndex ) : raise TypeError ( 'Unsupported type: {}' . format ( type ( index ) ) ) correct_index = pd . date_range ( index [ 0 ] , periods = len ( index ) , freq = index . freq ) if not correct_index . equals ( index ) : raise IndexError ( 'Index has gaps.' )