By default, describe() only summarizes numeric columns, silently skipping text/object columns entirely, since statistics like mean and standard deviation don't apply to them. Passing include='object', or include='all', expands the summary to include non-numeric columns too, which get a different set of statistics instead — count, number of unique values, the most frequent value, and its frequency — since numeric summary stats don't make sense for them.
1Understanding df.describe()
By default, describe() only summarizes numeric columns, silently skipping text/object columns entirely, since statistics like mean and standard deviation don't apply to them. Passing include='object', or include='all', expands the summary to include non-numeric columns too, which get a different set of statistics instead — count, number of unique values, the most frequent value, and its frequency — since numeric summary stats don't make sense for them.
Pass include='all' to df.describe() to get a summary covering every column, both numeric and non-numeric, instead of describe()'s default of silently including only the numeric ones.
import pandas as pd
df = pd.DataFrame({"age": [25, 30, 35, 40, 45]})
print(df.describe())2Practical Example
Here is a real-world application of df.describe() showing how it is used in production Pandas code.
import pandas as pd
df = pd.DataFrame({"name": ["Alice", "Bob", "Alice"], "age": [30, 25, 35]})
print(df.describe(include="all"))3Best Practices
Follow these guidelines when working with df.describe():
1. Use describe() as a fast first look at a numeric dataset's overall distribution, before diving into more detailed analysis or visualization
2. Pass include='object' or include='all' explicitly when text/categorical columns also need summarizing, since the default silently excludes them
3. Compare describe()'s min/max/quartiles against expected real-world ranges to catch obviously invalid data, like a negative age, early
Tip: Pass include='all' to df.describe() to get a summary covering every column, both numeric and non-numeric, instead of describe()'s default of silently including only the numeric ones.
import pandas as pd
df = pd.DataFrame({"age": [25, 30, 35, 40, 45]})
print(df.describe())