Skip to content

Instantly share code, notes, and snippets.

View gist:9459517
import json
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.neighbors.kde import KernelDensity
file_name_business = 'yelp_academic_dataset_business.json'
file_name_checkin = 'yelp_academic_dataset_checkin.json'
file_name_review = 'yelp_academic_dataset_review.json'
file_name_user = 'yelp_academic_dataset_user.json'
def read_data(file_name):
View gist:9823465
import pickle
import seaborn as sns
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
import pymc as pm
review = pickle.load(open('pickles/review.pkl'))
review['date'] = pd.to_datetime(review['date'])
View gist:9898311
import pickle
import seaborn as sns
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
import pymc as pm
import math
import pdb
View gist:9900461
import pickle
import seaborn as sns
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
import pymc as pm
import math
import pdb
View gist:9925745
import pickle
import seaborn as sns
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
import pymc as pm
import math
import pdb
View gist:9939408
import pickle
import seaborn as sns
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
import pymc as pm
import math
import pdb
View gist:9944886
import pickle
import seaborn as sns
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
import pymc as pm
import math
import pdb
View gist:9944874
import pickle
import seaborn as sns
import pandas as pd
import numpy as np
from collections import Counter
import matplotlib.pyplot as plt
import pymc as pm
import math
import pdb
View gist:07d66c402b14bdb6c398
collect=[]
def fib(length):
first = 1
second = 1
if length < 2:
return length
else:
collect = [0,1,1]
length = length-2
for i in range(length):
View gist:c3ccd51c17aec9fb9ae1
class montymc(object):
"""
### VARIABLES ###
samples = how many trials to run
simulations = number of simulations of X samples
doors = number of doors for the game (default: 3)
switch dictates what the user does after monty opens the door:
switch = 0, no switching
switch = 1, always switch
switch = 2, random