-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
  • 52,115
  • 13
  • 74
  • 94

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,138
  • 2
  • 37
  • 53