When calling the dtypes attribute on a pandas data frame, the last line of the output is usually dtype: object. For example:
In [1]: import pandas as pd
In [2]: df = pd.DataFrame({'numbers':100,'floats': 5.75,'name':'Jill'},index=['a'])
In [3]: df.dtypes
Out[3]:
numbers int64
floats float64
name object
dtype: object
What is the dtype: object line referring to in the output?
pandas.DataFrame.dtypes is a pd.Series object, so that's just the dtype of the Series that holds your dtypes!
>>> type(df.dtypes)
<class 'pandas.core.series.Series'>
That makes sense, since it holds numpy.dtype objects:
>>> df.dtypes.map(type)
numbers <class 'numpy.dtype'>
floats <class 'numpy.dtype'>
name <class 'numpy.dtype'>
dtype: object
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With