Skip to content

Commit

Permalink
rename concatenate -> concat_horizontal
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromedockes committed Nov 17, 2023
1 parent 1be7187 commit c09f577
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions skrub/_dataframe/_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"select",
"drop",
"Selector",
"concatenate",
"concat_horizontal",
"any_rowwise",
"to_pandas",
]
Expand Down Expand Up @@ -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
]
Expand Down
4 changes: 2 additions & 2 deletions skrub/_dataframe/_polars.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"select",
"drop",
"Selector",
"concatenate",
"concat_horizontal",
"any_rowwise",
"to_pandas",
]
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions skrub/_dataframe/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion skrub/_interpolation_joiner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit c09f577

Please sign in to comment.