typical_answers#

SurveyTangles.typical_answers(only_affected_questions: bool = True, column_selection: str | int | list | ndarray | Series | range | Callable[[SurveyVariable], bool] | None = None, insert_labels: bool = True, extract_const_answers: bool = False, only_max_level_tangles: bool = False) DataFrame | None | Tuple[DataFrame, DataFrame]#

Create a dataframe containing the ‘typical’ answers given by each tangle.

Parameters#

only_affected_questionsbool

If True, the questions corresponding to features (or separations) that were not specified (or oriented) are not included in the result.

column_selectionstr, int, list, np.ndarray, pd.Series, range, QuestionSelector or None

If None, all columns are taken into account. Otherwise, a subset will be considered. The parameter is interpreted as described in Survey.interpret_column_selection().

insert_labelsbool

If True, the variable names in the metadata are replaced by the variables’ labels. Often the label is the question text.

extract_const_answersbool

If True, two dataframes are returned, one containing the answers that are typical in every tangle and one containing the typical answers.

only_max_level_tanglesbool

If True, remove tangles that do not specify all features.

Returns#

pandas.DataFrame or tuple (DataFrame, DataFrame)

A dataframe containing the ‘typical’ answers in each tangle, or tuple with the answers that are typical in every tangle in its first component and the typical answers in its second component.