Skip to content

Instantly share code, notes, and snippets.

@JarrydWannenburg
Created August 26, 2022 18:55
Show Gist options
  • Save JarrydWannenburg/d5e59a8b1d844150b13b4a6f25c01168 to your computer and use it in GitHub Desktop.
Save JarrydWannenburg/d5e59a8b1d844150b13b4a6f25c01168 to your computer and use it in GitHub Desktop.
Scalable_Pipeline_Article
class Ordinal_Columns(BaseEstimator, TransformerMixin):
def __init__(self, names=['Deck','Deck2']): #,'Deck2'
self.names = names
def fit(self, X, y=None):
return self
def transform(self, X, y=None):
if len(self.names) > 0:
if len(self.names) == 1:
X_ = X[self.names].copy()
else:
X_ = X[self.names].copy()
return X_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment