Closed
Description
Code Sample, a copy-pastable example if possible
In [1]: import pandas as pd
In [2]: from datetime import datetime
In [3]: s = pd.Series([datetime(2014, 7, 9),
...: datetime(2014, 7, 10),
...: datetime(2014, 7, 11)])
In [4]: df = pd.DataFrame({'numeric':[1,2,3],
...: 'datetime':s})
In [5]: df.mean()
Out[5]:
numeric 2.0
dtype: float64
In [6]: s.mean()
Out[6]: Timestamp('2014-07-10 00:00:00')
Problem description
[this should explain why the current behaviour is a problem and why the expected output is a better solution.]
As of pandas 0.25 it is possible to apply mean() to a datetime series. However, DataFrame.mean() ignores datetimes series columns rather than returning the mean of the datetime series as one might expect.
Expected Output
When axis=0, output could be a dataframe with dtype as the first row, and the value as the second row.