wesm/pandas — Issue #678: Int64Index and pivot_table
Author: dieterv77
Created: 2012-01-24 17:50:13+00:00
State: open

I found an issue related to having an Int64Index and using pivot_table.

Here's the code that illustrates the problem:
#Start code
import itertools
import datetime
import pandas

d = datetime.date.min
data = list(itertools.product(['foo', 'bar'], ['A', 'B', 'C'],['x1', 'x2'],[d + datetime.timedelta(i) for i in xrange(20)], [1.0]))

print data[0]
df = pandas.DataFrame(data)

df2 = pandas.pivot_table(df, values=4, rows=[0,1,3],cols=[2])
print df2.columns

df = df.rename(columns=lambda x: str(x))
df2 = pandas.pivot_table(df, values='4', rows=['0','1','3'],cols=['2'])
print df2.columns
#end code

I would expect the columns of the pivoted table to be the same regardless of whether the column index of the original table
is ints or strings. I'm finding that this is not the case.

thanks in advance for looking into it.