Skip to content

Instantly share code, notes, and snippets.

@adiamaan92
Created January 27, 2019 17:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adiamaan92/740405b6405a6644fd16d3a50588de51 to your computer and use it in GitHub Desktop.
Save adiamaan92/740405b6405a6644fd16d3a50588de51 to your computer and use it in GitHub Desktop.
(
wine.pipe(csnap)
.rename(columns={"color_intensity": "ci"})
.assign(color_filter=lambda x: np.where((x.hue > 1) & (x.ci > 7), 1, 0))
.pipe(csnap)
.query("alcohol > 14")
.pipe(csnap)
.sort_values("alcohol", ascending=False)
.reset_index(drop=True)
.loc[:, ["alcohol", "ci", "hue"]]
.pipe(csnap, lambda x: x.sample(5))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment