Created
November 1, 2020 00:04
-
-
Save erraticgenerator/0bfa88d8be5f3d48c6d564bfd77ea591 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
import re | |
def filter_fonts(df, regex_filters): | |
df_new = pd.concat([df.filter(regex=re.compile(regex, re.IGNORECASE), axis=1).sum(axis=1).astype(bool) for regex in regex_filters], axis=1) | |
mask = df_new.all(axis=1) | |
return list(df.loc[mask].family) | |
filtered_fontnames = filter_fonts(df, ['Black', 'cyrillic', '_serif']) | |
filtered_fontnames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment