Skip to content

Instantly share code, notes, and snippets.

@adiamaan92
Created January 27, 2019 17:05
Show Gist options
  • Save adiamaan92/d8ebee8937d271452def2a7314993b2f to your computer and use it in GitHub Desktop.
Save adiamaan92/d8ebee8937d271452def2a7314993b2f to your computer and use it in GitHub Desktop.
wine_mc_example
(
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