set_variable_names#

Survey.set_variable_names(names: list | ndarray | Series, column_selection: str | int | list | ndarray | Series | range | Callable[[SurveyVariable], bool] | None = None)#

Replace the names of selected variables.

Note that this changes the index of the dataframe columns and variable info data structure of this object.

Parameters#

nameslist, np.ndarray or pandas.Series

New names.

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().