1

While playing around with pandas I started wondering about the output.

> df = pd.DataFrame({'col_1':[1,2,3], 'col_2':['a','b','c']})
> df.dtypes
  col_1     int64
  col_2    object
  dtype: object

The df.dtypes call gives three rows.

  1. The first row shows that col_1 has an "integer" type.
  2. The second row shows that col_2 has an "object" type, which is a string.
  3. The third row mentions dtype: object... but what is this referring to?
cantdutchthis
  • 31,949
  • 17
  • 74
  • 114

1 Answers1

2

The object returned by dtypes is a pandas.Series object, by default a Series shows it's dtype when printed, it's telling you it is a Series od mixed types (since you have int64 and object)

Luc Blassel
  • 394
  • 4
  • 15