I am running 'describe()' on a dataframe and getting summaries of only int columns (pandas 14.0).
The documentation says that for object columns frequency of most common value, and additional statistics would be returned. What could be wrong? (no error message is returned by the way)
Edit:
I think it's how the function is set to behave on mixed column types in a dataframe. Although the documentation fails to mention it.
Example code:
df_test = pd.DataFrame({'$a':[1,2], '$b': [10,20]})
df_test.dtypes
df_test.describe()
df_test['$a'] = df_test['$a'].astype(str)
df_test.describe()
df_test['$a'].describe()
df_test['$b'].describe()
My ugly work around in the meanwhile:
def my_df_describe(df):
objects = []
numerics = []
for c in df:
if (df[c].dtype == object):
objects.append(c)
else:
numerics.append(c)
return df[numerics].describe(), df[objects].describe()