@@ -7298,9 +7298,9 @@ def describe(self, percentiles=None, include=None, exclude=None):
7298
7298
Describing a ``DataFrame``. By default only numeric fields
7299
7299
are returned.
7300
7300
7301
- >>> df = pd.DataFrame({ 'object ': ['a', 'b', 'c'] ,
7301
+ >>> df = pd.DataFrame({ 'categorical ': pd.Categorical(['d','e','f']) ,
7302
7302
... 'numeric': [1, 2, 3],
7303
- ... 'categorical ': pd.Categorical(['d','e','f'])
7303
+ ... 'object ': ['a', 'b', 'c']
7304
7304
... })
7305
7305
>>> df.describe()
7306
7306
numeric
@@ -7316,18 +7316,18 @@ def describe(self, percentiles=None, include=None, exclude=None):
7316
7316
Describing all columns of a ``DataFrame`` regardless of data type.
7317
7317
7318
7318
>>> df.describe(include='all')
7319
- object numeric categorical
7320
- count 3 3.0 3
7321
- unique 3 NaN 3
7322
- top c NaN f
7323
- freq 1 NaN 1
7324
- mean NaN 2.0 NaN
7325
- std NaN 1.0 NaN
7326
- min NaN 1.0 NaN
7327
- 25% NaN 1.5 NaN
7328
- 50% NaN 2.0 NaN
7329
- 75% NaN 2.5 NaN
7330
- max NaN 3.0 NaN
7319
+ categorical numeric object
7320
+ count 3 3.0 3
7321
+ unique 3 NaN 3
7322
+ top f NaN c
7323
+ freq 1 NaN 1
7324
+ mean NaN 2.0 NaN
7325
+ std NaN 1.0 NaN
7326
+ min NaN 1.0 NaN
7327
+ 25% NaN 1.5 NaN
7328
+ 50% NaN 2.0 NaN
7329
+ 75% NaN 2.5 NaN
7330
+ max NaN 3.0 NaN
7331
7331
7332
7332
Describing a column from a ``DataFrame`` by accessing it as
7333
7333
an attribute.
@@ -7377,27 +7377,27 @@ def describe(self, percentiles=None, include=None, exclude=None):
7377
7377
Excluding numeric columns from a ``DataFrame`` description.
7378
7378
7379
7379
>>> df.describe(exclude=[np.number])
7380
- object categorical
7381
- count 3 3
7382
- unique 3 3
7383
- top c f
7384
- freq 1 1
7380
+ categorical object
7381
+ count 3 3
7382
+ unique 3 3
7383
+ top f c
7384
+ freq 1 1
7385
7385
7386
7386
Excluding object columns from a ``DataFrame`` description.
7387
7387
7388
7388
>>> df.describe(exclude=[np.object])
7389
- numeric categorical
7390
- count 3.0 3
7391
- unique NaN 3
7392
- top NaN f
7393
- freq NaN 1
7394
- mean 2.0 NaN
7395
- std 1.0 NaN
7396
- min 1.0 NaN
7397
- 25% 1.5 NaN
7398
- 50% 2.0 NaN
7399
- 75% 2.5 NaN
7400
- max 3.0 NaN
7389
+ categorical numeric
7390
+ count 3 3.0
7391
+ unique 3 NaN
7392
+ top f NaN
7393
+ freq 1 NaN
7394
+ mean NaN 2.0
7395
+ std NaN 1.0
7396
+ min NaN 1.0
7397
+ 25% NaN 1.5
7398
+ 50% NaN 2.0
7399
+ 75% NaN 2.5
7400
+ max NaN 3.0
7401
7401
7402
7402
See Also
7403
7403
--------
0 commit comments