Skip to content

Instantly share code, notes, and snippets.

@erraticgenerator
Created November 1, 2020 00:03
Show Gist options
  • Save erraticgenerator/03f27ac0b1079cb83d3511a6560d9f96 to your computer and use it in GitHub Desktop.
Save erraticgenerator/03f27ac0b1079cb83d3511a6560d9f96 to your computer and use it in GitHub Desktop.
regex_filters = ['_regular', '_japanese', '_serif']
df_new = pd.concat([df.filter(regex=regex, axis=1).sum(axis=1).astype(bool) for regex in regex_filters], axis=1)
mask = df_new.all(axis=1)
df.loc[mask]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment