Skip to content

Instantly share code, notes, and snippets.

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):
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'])
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
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
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
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
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
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
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):
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