Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. iterables = [['milk', 'honey', 'dates'], ['jan', 'feb', 'mar', 'apr']]
  2. i = pd.MultiIndex.from_product(iterables, names=['good', 'month'])
  3. xf = pd.DataFrame(index = i)
  4. xf['price'] = np.random.randint(1, 25, xf.shape[0])
  5.  
  6. allocation_vector = pd.Series([0.3, 0.6, 0.1], index = ['milk', 'honey', 'dates'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement