df = pd.DataFrame({'data': pd.Series([np.nan] * 3 + [20, 30, 40] + [np.nan] *
    3, rng), 'data1': pd.Series([np.nan] * 2 + [20, 30, 40, 30] + [np.nan] *
    3, rng), 'data2': pd.Series([np.nan] * 1 + [10, 20, 20, 30, 40] + [np.
    nan] * 3, rng)})
Zero fill data frame forward fill