<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _build_calmar_data(self):
 """ Builds the data dictionnary used as calmar input argument """

        # Select only filtered entities
        assert self.initial_weight_name is not None
        data = pd.DataFrame()
        data[self.initial_weight_name] = self.initial_weight * self.filter_by
        for variable in self.margins_by_variable:
            if variable == 'total_population':
                continue
            assert variable in self.survey_scenario.tax_benefit_system.variables
            period = self.period
            data[variable] = self.survey_scenario.calculate_variable(variable = variable, period = period)

        return data