-2

That is what I have:

In:  u = np.random.choice(['Male','Female'], len(null_Gender), p = P_Gender)
In:  Counter(u)
Out: Counter({'Female': 115730, 'Male': 357627})

I would like to extract the count values, without writing them manually.

khelwood
  • 55,782
  • 14
  • 81
  • 108

1 Answers1

1

collections.Counter is a subclass of dict, so you can just call values

from collections import Counter

c = Counter({'Female': 115730, 'Male': 357627})
print(list(c.values()))
>>> [357627, 115730]
Wondercricket
  • 7,651
  • 2
  • 39
  • 58