#NEWLINE# def apply_fit_filters( self , choosers , alternatives ) : #NEWLINE# #INDENT# '\n        Filter `choosers` and `alternatives` for fitting.\n        This is done by filtering each submodel and concatenating\n        the results.\n\n        Parameters\n        ----------\n        choosers : pandas.DataFrame\n            Table describing the agents making choices, e.g. households.\n        alternatives : pandas.DataFrame\n            Table describing the things from which agents are choosing,\n            e.g. buildings.\n\n        Returns\n        -------\n        filtered_choosers, filtered_alts : pandas.DataFrame\n\n        ' #NEWLINE# ch = [ ] #NEWLINE# alts = [ ] #NEWLINE# for ( name , df ) in self . _iter_groups ( choosers ) : #NEWLINE# #INDENT# ( filtered_choosers , filtered_alts ) = self . models [ name ] . apply_fit_filters ( df , alternatives ) #NEWLINE# ch . append ( filtered_choosers ) #NEWLINE# alts . append ( self ) #NEWLINE# #UNINDENT# return ( pd . concat ( ch ) , pd . concat ( alts ) )