Skip to content

Commit c6cee43

Browse files
committed
ENH: add value_counts as top level function in API, close #1392
1 parent 3e904fd commit c6cee43

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

RELEASE.rst

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pandas 0.8.0
8181
- Add new ``cut`` function (patterned after R) for discretizing data into
8282
equal range-length bins or arbitrary breaks of your choosing (#415)
8383
- Add new ``qcut`` for cutting with quantiles (#1378)
84+
- Add ``value_counts`` top level array method (#1392)
8485
- Added Andrews curves plot tupe (#1325)
8586
- Add support for tox and Travis CI (#1382)
8687

pandas/core/algorithms.py

+8
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ def value_counts(values, sort=True, ascending=False):
141141
"""
142142
Compute a histogram of the counts of non-null values
143143
144+
Parameters
145+
----------
146+
values : ndarray (1-d)
147+
sort : boolean, default True
148+
Sort by values
149+
ascending : boolean, default False
150+
Sort in ascending order
151+
144152
Returns
145153
-------
146154
value_counts : Series

pandas/core/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import numpy as np
55

6-
from pandas.core.algorithms import factorize, match, unique
6+
from pandas.core.algorithms import factorize, match, unique, value_counts
77

88
from pandas.core.common import isnull, notnull, save, load
99
from pandas.core.factor import Factor

0 commit comments

Comments
 (0)