Skip to content

Commit

Permalink
remove redundant checks and use list comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
fnhirwa committed May 20, 2024
1 parent ccd7ae6 commit 91a07b2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sktime/forecasting/compose/_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1583,13 +1583,10 @@ def _get_X_for_fcX(self, X):
return None

if ixx == "complement":
if X is None:
return None
all_columns = X.columns
if self.columns is not None:
complemented_columns = list(set(all_columns) - set(self.columns))
else:
complemented_columns = all_columns
complemented_columns = [
column for column in all_columns if column not in self.columns
]
return X.loc[:, complemented_columns]

ixx_pd = pd.Index(ixx)
Expand Down

0 comments on commit 91a07b2

Please sign in to comment.