In [69]:
%load_ext autoreload
%autoreload 2
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
In [106]:
from utils import load_population_data
zipcode_pop = load_population_data("../resources/population_data.csv")
In [107]:
zipcode_pop.iloc[:10]
Out[107]:
In [108]:
total_pop = zipcode_pop.sum(axis=0)
print total_pop
In [109]:
import numpy as np
pop_density = zipcode_pop / np.float64(total_pop)
In [110]:
pop_density.iloc[:10]
Out[110]:
In [111]:
pop_density.index[:10]
Out[111]:
In [135]:
from store import StoreGenerator
In [136]:
sg = StoreGenerator(zipcode_pop)
In [137]:
sg.create_stores(["01029", "03830", "05301", "10004"])
Out[137]:
In [138]:
stores = sg.generate_n(10)
In [139]:
print stores
In [140]:
from store import StoreSampler
In [141]:
ss = StoreSampler(stores)
In [142]:
ss.sample()
Out[142]:
In [144]:
from customer import CustomerGenerator
In [155]:
cg = CustomerGenerator(stores)
In [156]:
customers = cg.generate_n(10)
In [157]:
customers
Out[157]:
In [ ]: