Created
January 27, 2019 17:35
-
-
Save adiamaan92/794352132f6e82f36c2cc959d6e10b17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data = load_iris() | |
iris = pd.DataFrame(data.data, columns=data.feature_names) | |
( | |
iris.pipe(csnap, lambda x: x.head(), msg="Before") | |
.pipe( | |
setcols, | |
fn=lambda x: x.columns.str.lower() | |
.str.replace(r"\(cm\)", "") | |
.str.strip() | |
.str.replace(" ", "_"), | |
) | |
.pipe(csnap, lambda x: x.head(), msg="After") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment