find_numerical_variables#

feature_engine.variable_handling.find_numerical_variables(X)[source]#

Returns a list with the names of all the numerical variables in a dataframe.

More details in the User Guide.

Parameters
Xpandas dataframe of shape = [n_samples, n_features]

The dataset.

Returns
variables: List

The names of the numerical variables.

Examples

>>> import pandas as pd
>>> from feature_engine.variable_handling import find_numerical_variables
>>> X = pd.DataFrame({
>>>     "var_num": [1, 2, 3],
>>>     "var_cat": ["A", "B", "C"],
>>>     "var_date": pd.date_range("2020-02-24", periods=3, freq="T")
>>> })
>>> var_ = find_numerical_variables(X)
>>> var_
['var_num']
Return type

List[Union[str, int]]