Skip to content

Commit 245526b

Browse files
committed
added integer column label test
1 parent efae1bf commit 245526b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pandas/core/frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6932,7 +6932,7 @@ def value_counts(
69326932
69336933
Parameters
69346934
----------
6935-
subset : mapping, function, label, list of labels, optional
6935+
subset : label or list of labels, optional
69366936
Columns to use when counting unique combinations.
69376937
normalize : bool, default False
69386938
Return proportions rather than frequencies.

pandas/tests/frame/methods/test_value_counts.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,13 @@ def test_data_frame_value_counts_subset(nulls_fixture):
160160
index=pd.Index(["John", "Anne", "Beth"], name="first_name"),
161161
)
162162

163+
df = pd.DataFrame(
164+
{100: [2, 100, 5, 9], 200: [2, 6, 2, 6], 300: [4, 6, 2, 1]},
165+
)
166+
result = df.value_counts([200])
167+
expected = pd.Series(
168+
data=[2, 2],
169+
index=pd.Index([2, 6], name=200),
170+
)
171+
163172
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)