<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_funset(self, discrete):
 """ Converts the dataset to a set of `gringo.Fun`_ instances Parameters discrete : callable A discretization function Returns ------- set Representation of the dataset as a set of `gringo.Fun`_ instances .. _gringo.Fun: http://potassco.sourceforge.net/gringo.html#Fun """

        fs = self.clampings.to_funset("exp")
        fs = fs.union(self.setup.to_funset())

        for i, row in self.readouts.iterrows():
            for var, val in row.iteritems():
                if not np.isnan(val):
                    fs.add(gringo.Fun('obs', [i, var, discrete(val)]))

        return fs