Lets say I have the following dataframe:
df1 = pd.DataFrame(data = [1,np.nan,np.nan,1,1,np.nan,1,1,1], columns = [\'X\'],