02_munge/src/munge_noaa_nerrs.py
def fill_gaps(x):
    '''fills any data gaps in the middle of the input series
    using linear interpolation; returns gap-filled time series
    '''
    #find nans
    bd = np.isnan(x)

    #early exit if there are no nans  
    if not bd.any():
        return x

    #find nonnans index numbers
    gd = np.flatnonzero(~bd)

    #ignore leading and trailing nans
    bd[:gd.min()]=False
    bd[(gd.max()+1):]=False

    #interpolate nans
    x[bd] = np.interp(np.flatnonzero(bd),gd,x[gd])
    return x
fills any data gaps in the middle of the input series
    using linear interpolation; returns gap-filled time series
    
fills any data gaps in the middle of the input series
using linear interpolation; returns gap-filled time series
fills any data gaps in the middle of the input series using linear interpolation ; returns gap - filled time series
def fill_gaps(x):
    bd = np.isnan(x)
    if not bd.any():
        return x
    gd = np.flatnonzero(~bd)
    bd[:gd.min()]=False
    bd[(gd.max()+1):]=False
    x[bd] = np.interp(np.flatnonzero(bd),gd,x[gd])
    return x
def fill_gaps ( x ) : bd = np . isnan ( x ) if not bd . any ( ) : return x gd = np . flatnonzero ( ~ bd ) bd [ : gd . min ( ) ] = False bd [ ( gd . max ( ) + 1 ) : ] = False x [ bd ] = np . interp ( np . flatnonzero ( bd ) , gd , x [ gd ] ) return x
fills any data gaps in the middle of the input series
using linear interpolation; returns gap-filled time series
fills any data gaps in the middle of the input series using linear interpolation ; returns gap - filled time series
'''fills any data gaps in the middle of the input series
    using linear interpolation; returns gap-filled time series
    ''' #find nans #early exit if there are no nans   #find nonnans index numbers #ignore leading and trailing nans #interpolate nans
x