Closed
Description
import pandas as pd
import numpy as np
df = pd.DataFrame({'num':[1,2,3], 'num2': np.random.randn(3), 'strings':list('abc')})
df.sum().values # array(['6', '-1.47818918058', 'abc'], dtype=object)
The issue is that axis=0 tries to coerce the dtypes and np.array
will promote the numerics to strings.
Note that:
df.T.sum(axis=1).values # array([6, -1.4781891805780178, 'abc'], dtype=object)
Maybe com._coerce_to_dtypes
should just return the list?