You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
concat of panels with the same items and minor_axis (but different major_axis) on axis=2 worked in 0.8.1, but fails in 0.9.1
In [1]: import numpy as np
In [2]: import pandas
In [3]: pandas.__version__
Out[3]: '0.9.1'
In [4]: def make_panel():
...: index = 5
...: cols = 3
...: return pandas.Panel(dict([ ("Item%s" % x,pandas.DataFrame(np.random.randn(index,cols),index = [ "I%s" % i for i in range(index) ], columns = [ "C%s" % i for i in range(cols) ])) for x in ['A','B','C'] ]))
...:
In [5]: panel1 = make_panel()
In [6]: panel1
Out[6]:
<class 'pandas.core.panel.Panel'>
Dimensions: 3 (items) x 5 (major) x 3 (minor)
Items: ItemA to ItemC
Major axis: I0 to I4
Minor axis: C0 to C2
In [7]: panel2 = make_panel()
In [8]: panel2 = panel2.rename_axis(dict([ (x,"%s_1" % x) for x in panel2.major_axis ]), axis=1)
In [9]: panel2
Out[9]:
<class 'pandas.core.panel.Panel'>
Dimensions: 3 (items) x 5 (major) x 3 (minor)
Items: ItemA to ItemC
Major axis: I0_1 to I4_1
Minor axis: C0 to C2
In [10]: panel3 = make_panel()
In [11]: panel3 = panel2.rename_axis(dict([ (x,"%s_1" % x) for x in panel2.major_axis ]), axis=1).rename_axis(dict([ (x,"%s_1" % x) for x in panel2.minor_axis ]), axis=2)
In [12]: panel3
Out[12]:
<class 'pandas.core.panel.Panel'>
Dimensions: 3 (items) x 5 (major) x 3 (minor)
Items: ItemA to ItemC
Major axis: I0_1_1 to I4_1_1
Minor axis: C0_1 to C2_1
this works in 0.8.1 & 0.9.1
In [14]: pandas.concat([ panel1, panel2 ], axis = 1, verify_integrity = True)
Out[14]:
<class 'pandas.core.panel.Panel'>
Dimensions: 3 (items) x 10 (major) x 3 (minor)
Items: ItemA to ItemC
Major axis: I0 to I4_1
Minor axis: C0 to C2
concat of panels with the same items and minor_axis (but different major_axis) on axis=2 worked in 0.8.1, but fails in 0.9.1
this works in 0.8.1 & 0.9.1
fails under 0.9.1 (worked in 0.8.1)
The text was updated successfully, but these errors were encountered: