I am creating a multi indexed series like this :
index = [ ('America','California', 2000), ('America','California', 2010),
('Asia','Delhi', 2000), ('Asia','Delhi', 2010),
('Asia','HK', 2000), ('Asia','HK', 2010),
('America','Texas', 2000), ('America','Texas', 2010)
]
populations = [33871648, 37253956,18976457, 19378102,30861820, 35145561,20851820, 25145561]
new_index = pd.MultiIndex.from_tuples(index)
pop = pd.Series(populations, index=new_index).sort_index()
I am trying to retrieve values like this :
pop['America'] # works
pop['America','Texas',2010] # works
pop['America','Texas'] # works
How to get for america, any city, but 2010?
pop['America',:,2010] # not working
How to use slicing in situations like this ?