@classmethod
def from_df(cls, df, **kwargs):
    """Constructs instance from dataframe containing
           ranged/positioned data."""
    if df.index.nlevels == 3:
        return cls(df, **kwargs)
    elif df.index.nlevels == 2:
        return cls.from_position_df(df, **kwargs)
    else:
        raise ValueError(
            'DataFrame should have either two index levels (for positioned data) or three index levels (for ranged data)'
            )
