(self)
return Monomial(temp_variables, Monomial._rationalize_if_possible(self.coeff))
Clean the monomial by dropping any variables that have power 0.
Clean the monomial by dropping any variables that have power 0.
Clean the monomial by dropping any variables that have power 0 .
def clean(self):
        """
        Clean the monomial by dropping any variables that have power 0.
        """
        temp_variables = {i: self.variables[i] for i in self.variables if self.variables[i] != 0}
        return Monomial(temp_variables, Monomial._rationalize_if_possible(self.coeff))
def clean ( self ) : temp_variables = { i : self . variables [ i ] for i in self . variables if self . variables [ i ] != 0 } return Monomial ( temp_variables , Monomial . _rationalize_if_possible ( self . coeff ) )