pivot_table aggregate changes data type · Issue #713 · pandas-dev/pandas (original) (raw)

@kieranholland

Description

@kieranholland

IMHO the result should be integer type:

df = DataFrame({
    'x':('a', 'b'),
    'y':('A', 'B'),
    'i':(1, 2),
})
pivot_table(df, rows='x', cols='y')
y  A    B  
x          
a  1.0  NaN
b  NaN  2.0

Love pandas!