def is_shape(df, shape):
    try:
        check = np.all(np.equal(df.shape, shape) | (np.equal(shape, [-1, -1]) |
                                                    np.equal(shape, [None, None])))
        assert check
    except AssertionError as e:
        msg = ("Expected shape: {}\n"
               "\t\tActual shape:   {}".format(shape, df.shape))
        e.args = (msg,)
        raise
    return df
Asserts that the DataFrame is of a known shape.
dataset/ETHPy150Open TomAugspurger/engarde/engarde/checks.py/is_shape