Last active
October 10, 2019 03:13
-
-
Save brockmanmatt/1ff604b2b777f46a6c658895d75e94b5 to your computer and use it in GitHub Desktop.
PullSelectNewsArticles
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
mySources = ["nytimes.com", "washingtonpost.com", "foxnews.com", "cnn.com"] | |
df = pd.DataFrame() | |
k = os.listdir("data") | |
for i in k: | |
print(i) | |
if i.endswith(".pkl"): | |
tmp = pd.read_pickle("data/"+i) | |
tmp = tmp[tmp["SOURCES"].apply(lambda x: x in mySources)] | |
df = pd.concat([df, tmp]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment