pandas.Series.describe¶
Generate descriptive statistics that summarize the central tendency,
dispersion and shape of a dataset’s distribution, excluding
NaN
values.
Analyzes both numeric and object series, as well
as DataFrame
column sets of mixed data types. The output
will vary depending on what is provided. Refer to the notes
below for more detail.
- param percentiles
- list-like of numbers, optional
The percentiles to include in the output. All should fall between 0 and 1. The default is
[.25, .5, .75]
, which returns the 25th, 50th, and 75th percentiles.
- param include
- ‘all’, list-like of dtypes or None (default), optional
A white list of data types to include in the result. Ignored for
Series
. Here are the options:‘all’ : All columns of the input will be included in the output.
- A list-like of dtypesLimits the results to the
provided data types. To limit the result to numeric types submit
numpy.number
. To limit it instead to object columns submit thenumpy.object
data type. Strings can also be used in the style ofselect_dtypes
(e.g.df.describe(include=['O'])
). To select pandas categorical columns, use'category'
None (default) : The result will include all numeric columns.
- param exclude
- list-like of dtypes or None (default), optional,
A black list of data types to omit from the result. Ignored for
Series
. Here are the options:- A list-like of dtypesExcludes the provided data types
from the result. To exclude numeric types submit
numpy.number
. To exclude object columns submit the data typenumpy.object
. Strings can also be used in the style ofselect_dtypes
(e.g.df.describe(include=['O'])
). To exclude pandas categorical columns, use'category'
None (default) : The result will exclude nothing.
- return
Series or DataFrame Summary statistics of the Series or Dataframe provided.
Limitations¶
Parameters
include
andexclude
are currently unsupported by Intel Scalable Dataframe Compiler.For string Series resulting values are returned as strings.
Examples¶
import numpy as np
import pandas as pd
from numba import njit
@njit
def series_describe():
s = pd.Series([5., 0, 3.3, 4.4, 9.2])
return s.describe()
print(series_describe())
$ python ./series/series_describe.py
count 5.000000
mean 4.380000
std 3.315419
min 0.000000
25% 3.300000
50% 4.400000
75% 5.000000
max 9.200000
dtype: float64
See also
- DataFrame.count
Count number of non-NA/null observations.
- DataFrame.max
Maximum of the values in the object.
- DataFrame.min
Minimum of the values in the object.
- DataFrame.mean
Mean of the values.
- DataFrame.std
Standard deviation of the observations.
- DataFrame.select_dtypes
Subset of a DataFrame including/excluding columns based on their dtype.