-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
API DesignBugIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesMultiIndex
Milestone
Description
This should align on the columns axis. Not clear how to specify the alignment level though (e.g. broadcasting would be tricky here).
import numpy as np
import pandas as pd
arrays = [np.hstack([ ['one']*3, ['two']*3]), ['Dog', 'Bird', 'Cat']*2]
columns = pd.MultiIndex.from_arrays(arrays, names=['foo', 'bar'])
df = pd.DataFrame(np.zeros((3,6)),columns=columns,
index=pd.date_range('20000103',periods=3))
df['one'] = pd.DataFrame({'Bird' : np.ones(3)*2,
'Dog' : np.ones(3),
'Cat' : np.ones(3)*3},
index= pd.date_range('20000103',periods=3))
df['two'] = pd.DataFrame({'Dog' : np.ones(3)*4,
'Bird' : np.ones(3)*5,
'Cat' : np.ones(3)*6,},
index= pd.date_range('20000103',periods=3))
Metadata
Metadata
Assignees
Labels
API DesignBugIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesMultiIndex