<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_pandas_dataframe(cls, bqm_df, offset=0.0, interactions=None):
 """Create a binary quadratic model from a QUBO model formatted as a pandas DataFrame. Args: bqm_df (:class:`pandas.DataFrame`):
 Quadratic unconstrained binary optimization (QUBO) model formatted as a pandas DataFrame. Row and column indices label the QUBO variables; values are QUBO coefficients. offset (optional, default=0.0):
 Constant offset for the binary quadratic model. interactions (iterable, optional, default=[]):
 Any additional 0.0-bias interactions to be added to the binary quadratic model. Returns: :class:`.BinaryQuadraticModel`: Binary quadratic model with vartype set to :class:`vartype.BINARY`. Examples: This example creates a binary quadratic model from a QUBO in pandas DataFrame format while adding an interaction and setting a constant offset. 0 1 0 -1 2 1 0 -1 {0: -1, 1: -1.0, 2: 0.0} {(0, 1):
 2, (0, 2):
 0.0, (1, 2):
 0.0} 2.5 <Vartype.BINARY: frozenset({0, 1})> """

        if interactions is None:
            interactions = []

        bqm = cls({}, {}, offset, Vartype.BINARY)

        for u, row in bqm_df.iterrows():
            for v, bias in row.iteritems():
                if u == v:
                    bqm.add_variable(u, bias)
                elif bias:
                    bqm.add_interaction(u, v, bias)

        for u, v in interactions:
            bqm.add_interaction(u, v, 0.0)

        return bqm