Pandas DataFrame iloc spoils the data type
问题 Having pandas 0.19.2. Here's an example: testdf = pd.DataFrame({'A': [1, 2, 3, 4], 'B': [1.0, 2.0, 3.0, 4.0]}) testdf.dtypes Output: A int64 B float64 dtype: object Everything looks fine for now, but what I don't like is that (note, that first call is a pd.Series.iloc and the second one is pd.DataFrame.iloc ) print(type(testdf.A.iloc[0])) print(type(testdf.iloc[0].A)) Output: <class 'numpy.int64'> <class 'numpy.float64'> I found it while trying to understand why pd.DataFrame.join() operation