Closed
Description
Using groupby(level=0).first()
or groupby(level=0).last()
to eliminate duplicate index entries modifies integer data types to float.
import pandas as pd
idx = range(10)
idx.append(9)
df = pd.Series(data=range(11), index=idx, name='IntCol')
print df
print df.dtype
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
9 10
Name: IntCol
int64
df2 = df.groupby(level=0).first()
print df2
print df2.dtype
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
float64