diff --git a/src/pandas_profiling/model/correlations.py b/src/pandas_profiling/model/correlations.py index 580cd1807..7698e85e6 100644 --- a/src/pandas_profiling/model/correlations.py +++ b/src/pandas_profiling/model/correlations.py @@ -25,7 +25,7 @@ class Auto(Correlation): @staticmethod @multimethod def compute( - config: Settings, df: Sized, summary: dict, n_bins: int + config: Settings, df: Sized, summary: dict ) -> Optional[Sized]: raise NotImplementedError() diff --git a/src/pandas_profiling/model/pandas/correlations_pandas.py b/src/pandas_profiling/model/pandas/correlations_pandas.py index e96a771e4..b88581b27 100644 --- a/src/pandas_profiling/model/pandas/correlations_pandas.py +++ b/src/pandas_profiling/model/pandas/correlations_pandas.py @@ -156,12 +156,11 @@ def pandas_phik_compute( return correlation -@Auto.compute.register(Settings, pd.DataFrame, dict, int) +@Auto.compute.register(Settings, pd.DataFrame, dict) def pandas_auto_compute( config: Settings, df: pd.DataFrame, - summary: dict, - n_bins: int = 10, + summary: dict ) -> Optional[pd.DataFrame]: threshold = config.categorical_maximum_correlation_distinct @@ -175,7 +174,7 @@ def pandas_auto_compute( and value["n_distinct"] <= threshold ] df_discretized = Discretizer( - DiscretizationType.UNIFORM, n_bins=n_bins + DiscretizationType.UNIFORM, n_bins=config.correlations["auto"].n_bins ).discretize_dataframe(df) columns_tested = numerical_columns + categorical_columns correlation_matrix = pd.DataFrame(