File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ pandas 0.13
121
121
(:issue: `4405 `, :issue: `4437 `)
122
122
- Fixed a py3 compat issue where bytes were being repr'd as tuples
123
123
(:issue: `4455 `)
124
+ - Fixed Panel attribute naming conflict if item is named 'a'
125
+ (:issue: `3440 `)
124
126
125
127
pandas 0.12
126
128
===========
Original file line number Diff line number Diff line change @@ -165,12 +165,12 @@ class Panel(NDFrame):
165
165
"""
166
166
167
167
_AXIS_ORDERS = ['items' , 'major_axis' , 'minor_axis' ]
168
- _AXIS_NUMBERS = dict ([ (a , i ) for i , a in enumerate (_AXIS_ORDERS )] )
168
+ _AXIS_NUMBERS = dict ((a , i ) for i , a in enumerate (_AXIS_ORDERS ))
169
169
_AXIS_ALIASES = {
170
170
'major' : 'major_axis' ,
171
171
'minor' : 'minor_axis'
172
172
}
173
- _AXIS_NAMES = dict ([( i , a ) for i , a in enumerate (_AXIS_ORDERS )] )
173
+ _AXIS_NAMES = dict (enumerate (_AXIS_ORDERS ))
174
174
_AXIS_SLICEMAP = {
175
175
'major_axis' : 'index' ,
176
176
'minor_axis' : 'columns'
Original file line number Diff line number Diff line change @@ -1340,6 +1340,12 @@ def test_rename(self):
1340
1340
def test_get_attr (self ):
1341
1341
assert_frame_equal (self .panel ['ItemA' ], self .panel .ItemA )
1342
1342
1343
+ # specific cases from #3440
1344
+ self .panel ['a' ] = self .panel ['ItemA' ]
1345
+ assert_frame_equal (self .panel ['a' ], self .panel .a )
1346
+ self .panel ['i' ] = self .panel ['ItemA' ]
1347
+ assert_frame_equal (self .panel ['i' ], self .panel .i )
1348
+
1343
1349
def test_group_agg (self ):
1344
1350
values = np .ones ((10 , 2 )) * np .arange (10 ).reshape ((10 , 1 ))
1345
1351
bounds = np .arange (5 ) * 2
You can’t perform that action at this time.
0 commit comments