Created
January 27, 2019 17:05
-
-
Save adiamaan92/d8ebee8937d271452def2a7314993b2f to your computer and use it in GitHub Desktop.
wine_mc_example
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
( | |
wine.rename(columns={"color_intensity": "ci"}) | |
.assign(color_filter=lambda x: np.where((x.hue > 1) & (x.ci > 7), 1, 0)) | |
.query("alcohol > 14 and color_filter == 1") | |
.sort_values("alcohol", ascending=False) | |
.reset_index(drop=True) | |
.loc[:, ["alcohol", "ci", "hue"]] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment