Module functions.matrixmixer.main
Classes
class MatrixMixer (meta_table: MetaTable2, breaks: list = [['tz']], language: str = 'de', weight: str = 'tz', special_variables_last: bool = True, study_title: str = 'Studie', significance_level: float = 0.05, use_conf_interval: bool = False, conf_interval: float = 0.95, column_width: int = 15, hide_total_break: bool = False)-
Assembles multiple tables with descriptive statistics and exports them to excel.
Args
meta_table:MetaTable2- MetaTable created using gfs_functions
breaks:list[str]- Selects the breaks used by default. Defaults to ['tz'].
language:str- Selects the language of the Matrix. Defaults to 'de'.
weight:str- Turns weight on if weight variable name is added. "gewicht", defaults to 'tz'
special_variables_last:bool- If True, special variables will be shown at the bottom. Defaults to True.
study_title:str- Title of the study. Defaults to 'Studie'.
use_conf_interval:bool- Show confidence intervals. Defaults to False.
conf_interval:float- change niveau of confidence interval. Defaults to .95.
column_width:int- Column width in Excel. Defaults to 15.
hide_total_break:bool- hides the "C" column, which is normally the "Total" break. Defaults to False.
Method generated by attrs for class MatrixMixer.
Class variables
var breaks : listvar column_width : intvar conf_interval : floatvar hide_total_break : boolvar language : strvar meta_table : MetaTable2var significance_level : floatvar special_variables_last : boolvar study_title : strvar use_conf_interval : boolvar weight : str
Methods
def add_title_page_info(self, study_title: str, clients: list[str], survey_methodology: str, sampling: str, quota_features: str, address_origin: list[str], population: str, weighting: str, survey_period: str, random_sample: str = None)-
sets title page info
Args
study_title:str- title of study
clients:list[str]- list of clients
survey_methodology:str- method used in study
sampling:str- sampling teqnique used
quota_features:str- feautures to quota was set on
address_origin:list[str]- origin of adresses
population:str- population of study
weighting:str- weighting variables or factors
survey_period:str- period in which the survey took place
random_sample:str- used to overwrite the random sample string, default is n = (number of recipients)
def create_matrix(self, question: str, breaks: list[list[str]] = 'auto', weight: str = 'auto', order_descending: Union[str, bool] = 'auto', special_variables: Union[str, list[int]] = 'auto', nps: bool = False, groupings: dict = None) ‑> None-
Creates a single matrix and saves it to the MatrixMixer object.
Args
question:str- Name of question. Can either be of type Column or Group.
breaks:list[list[str]], optional- Selects the breaks used in matrix. Defaults to 'auto'.
weight:str, optional- Selects the weight used in matrix. Defaults to 'auto'.
order_descending:Union[str, bool], optional- Orders the values descending or not. Use either False or True. Defaults to 'auto'.
special_variables:Union[str, list[int]], optional- List of special variables which will appear at the bottom. Could be something like [96, 97, 98, 99999997, 99999998]. Defaults to 'auto'.
nps:bool, optional- add nps to the matrix. Defaults to False.
groupings:dict, optional- groupings dictionary to create variables boxes. an example is {"Top-Box (ja, eher ja)":[1, 2]}. Defaults to None.
def export_excel(self, show_title_page: bool = True, show_combined_sheet: bool = True, show_percentage_sheet: bool = True, show_absolute_sheet: bool = False, show_debugging_sheet: bool = False, table_name: str = None) ‑> None-
Exports the matrices from the MatrixMixer to Excel.
Args
show_title_page:bool, optional- show a title page. Defaults to True.
show_combined_sheet:bool, optional- shows sheet with combined values. Defaults to True.
show_percentage_sheet:bool, optional- shows sheet with percentage values. Defaults to True.
show_absolute_sheet:bool, optional- shows sheet with absolute values. Defaults to False.
show_debugging_sheet:bool, optional- shows all sheets for debugging purposes. Defaults to False.
table_name:str, optional- Name of the exported table file. Defaults to None.