Closed
Description
When columns have an integer as their name, indexing them becomes inconsistent:
>>> import pandas as pd
>>> df = pd.DataFrame({1:[1,1],2:[2,2],'a':['a','a']})
>>> df
1 2 a
0 1 2 a
1 1 2 a
[2 rows x 3 columns]
>>> df[1]
0 1
1 1
Name: 1, dtype: int64
>>> df[['a',1]]
a 1
0 a 1
1 a 1
[2 rows x 2 columns]
>>> df[[1,2]]
2 a
0 2 a
1 2 a
[2 rows x 2 columns]
Desired behavior would be:
>>> df[[1,2]]
1 2
0 1 2
1 1 2
[2 rows x 2 columns]
This is in pandas 0.13.1