Skip to content

Instantly share code, notes, and snippets.

@brockmanmatt
brockmanmatt / introtologprobs.ipynb
Created July 25, 2020 22:13
introToLogProbs.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brockmanmatt
brockmanmatt / defaultapinotebook.ipynb
Last active November 18, 2023 02:50
defaultapinotebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brockmanmatt
brockmanmatt / explorecontextstuffing.ipynb
Created July 19, 2020 09:02
ExploreContextStuffing.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brockmanmatt
brockmanmatt / count01s.ipynb
Created July 20, 2020 03:09
Count01s.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
!pip install gdelt
import gdelt
gd = gdelt.gdelt(version=1)
import os
os.makedirs("data",exist_ok=True)
!pip install gdelt #make sure gdelt installed
import pandas as pd, numpy as np, matplotlib.pyplot as plt, gdelt, os, datetime, warnings #imports
gd = gdelt.gdelt(version=1) #instantiate object to pull gdelt files
os.makedirs("data",exist_ok=True) #check if there's a data folder
cur_date = datetime.datetime(2019,10,7)-datetime.timedelta(days=60) #start pulling from 60 days prior to 10/7
while cur_date < datetime.datetime(2019,10,7): #pull until 10/7
if not os.path.exists("data/%s-%s-%s.pkl"%(cur_date.year, cur_date.month, cur_date.day)): #if don't have
@brockmanmatt
brockmanmatt / qa_from_playgrond.ipynb
Last active September 15, 2020 23:30
QA_from_playgrond.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brockmanmatt
brockmanmatt / wic_selfcontextstuffingimproved3.ipynb
Created July 31, 2020 14:33
WiC_SelfContextStuffingImproved3.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brockmanmatt
brockmanmatt / explain2secondgraderlogprob.ipynb
Created July 30, 2020 16:28
explain2SecondGraderLogprob.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.