Closed
Description
I'm using pandas 0.11.0 and numpy 1.7.1 in Anaconda Python 1.6.0.
The iloc
method seems to coerce dtype of values in some cases. For example:
x5 = pd.DataFrame(index=['A','B','C'],columns=['foo','bar','baz'])
x5.foo = np.int16([-1,-2,-3])
x5.bar = np.uint16([1,2,3])
x5.baz = np.uint32([100000,200000,300000])
print x5
print x5.dtypes
foo bar baz
A -1 1 100000
B -2 2 200000
C -3 3 300000
foo int16
bar uint16
baz uint32
dtype: object
So far, so good. Now using iloc
, it seems to cause type coercion when a single row is selected:
print x5.iloc[1:2]
foo bar baz
B -2 2 200000
print x5.iloc[1]
foo 4294967294
bar 2
baz 200000
Name: B, dtype: uint32
Metadata
Metadata
Assignees
Labels
No labels