From c09f577a1e766e2657d94cf277ab6645a0e6ffb1 Mon Sep 17 00:00:00 2001 From: Jerome Dockes Date: Fri, 17 Nov 2023 11:58:25 +0100 Subject: [PATCH] rename concatenate -> concat_horizontal --- skrub/_dataframe/_pandas.py | 4 ++-- skrub/_dataframe/_polars.py | 4 ++-- skrub/_dataframe/tests/test_all.py | 6 +++--- skrub/_interpolation_joiner.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/skrub/_dataframe/_pandas.py b/skrub/_dataframe/_pandas.py index 2faf940f2..c64ebdff6 100644 --- a/skrub/_dataframe/_pandas.py +++ b/skrub/_dataframe/_pandas.py @@ -20,7 +20,7 @@ "select", "drop", "Selector", - "concatenate", + "concat_horizontal", "any_rowwise", "to_pandas", ] @@ -367,7 +367,7 @@ def any_rowwise(dataframe): return dataframe.any(axis=1) -def concatenate(dataframe, *other_dataframes): +def concat_horizontal(dataframe, *other_dataframes): other_dataframes = [ df.set_axis(dataframe.index, axis="index") for df in other_dataframes ] diff --git a/skrub/_dataframe/_polars.py b/skrub/_dataframe/_polars.py index e179d0b31..1b52ee6ea 100644 --- a/skrub/_dataframe/_polars.py +++ b/skrub/_dataframe/_polars.py @@ -25,7 +25,7 @@ "select", "drop", "Selector", - "concatenate", + "concat_horizontal", "any_rowwise", "to_pandas", ] @@ -307,7 +307,7 @@ def any_rowwise(dataframe): return _collect(dataframe.select(pl.any_horizontal(pl.all()))).get_column("any") -def concatenate(dataframe, *other_dataframes): +def concat_horizontal(dataframe, *other_dataframes): return pl.concat( [_collect(dataframe)] + [_collect(df) for df in other_dataframes], how="horizontal", diff --git a/skrub/_dataframe/tests/test_all.py b/skrub/_dataframe/tests/test_all.py index d46140968..8c18fdbc5 100644 --- a/skrub/_dataframe/tests/test_all.py +++ b/skrub/_dataframe/tests/test_all.py @@ -30,14 +30,14 @@ def test_drop(df): assert list(ns.drop(df, Selector.CATEGORICAL).columns) == ["ID", "temp"] -def test_concatenate(df): +def test_concat_horizontal(df): ns = skrubns(df) df1 = ( df.__dataframe_consortium_standard__() .rename_columns({c: f"{c}_1" for c in df.columns}) .dataframe ) - out = ns.concatenate(df) + out = ns.concat_horizontal(df) assert list(out.columns) == list(df.columns) - out = ns.concatenate(df, df1) + out = ns.concat_horizontal(df, df1) assert list(out.columns) == list(df.columns) + list(df1.columns) diff --git a/skrub/_interpolation_joiner.py b/skrub/_interpolation_joiner.py index 151eecaa4..f696dd4df 100644 --- a/skrub/_interpolation_joiner.py +++ b/skrub/_interpolation_joiner.py @@ -311,7 +311,7 @@ def transform(self, X): prediction_results = self._check_prediction_results(prediction_results) predictions = [res["predictions"] for res in prediction_results] predictions = _add_column_name_suffix(predictions, self.suffix) - return skrubns(self.aux_table).concatenate(X, *predictions) + return skrubns(self.aux_table).concat_horizontal(X, *predictions) def _check_prediction_results(self, results): checked_results = []