I am trying to get a list of tuples with the first and last index of grouped NaNs. An example input could look like
import pandas as pd
import numpy as np
series = pd.Series([1,2,3,np.nan,np.nan,4,5,6,7,np.nan,8,9,np.nan,np.nan,np.nan])
get_nan_inds(series)
and the output should be
[(3, 5), (9, 10), (12, 15)]
The only similar question I could find doesn't solve my problem.