Skip to content

Commit d365098

Browse files
committed
fixed order of columns
1 parent 916624c commit d365098

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

pandas/core/generic.py

+31-31
Original file line numberDiff line numberDiff line change
@@ -7298,9 +7298,9 @@ def describe(self, percentiles=None, include=None, exclude=None):
72987298
Describing a ``DataFrame``. By default only numeric fields
72997299
are returned.
73007300
7301-
>>> df = pd.DataFrame({ 'object': ['a', 'b', 'c'],
7301+
>>> df = pd.DataFrame({ 'categorical': pd.Categorical(['d','e','f']),
73027302
... 'numeric': [1, 2, 3],
7303-
... 'categorical': pd.Categorical(['d','e','f'])
7303+
... 'object': ['a', 'b', 'c']
73047304
... })
73057305
>>> df.describe()
73067306
numeric
@@ -7316,18 +7316,18 @@ def describe(self, percentiles=None, include=None, exclude=None):
73167316
Describing all columns of a ``DataFrame`` regardless of data type.
73177317
73187318
>>> 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
73317331
73327332
Describing a column from a ``DataFrame`` by accessing it as
73337333
an attribute.
@@ -7377,27 +7377,27 @@ def describe(self, percentiles=None, include=None, exclude=None):
73777377
Excluding numeric columns from a ``DataFrame`` description.
73787378
73797379
>>> 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
73857385
73867386
Excluding object columns from a ``DataFrame`` description.
73877387
73887388
>>> 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
74017401
74027402
See Also
74037403
--------

0 commit comments

Comments
 (0)