I probably have a simple question, but I can't find the answer on this platform. I have a set of columns in my dataset df, like this:
| A | B | C | D |
|---|---|---|---|
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
When I want the frequency of column A I have the following script:
df.A.value_counts()
And I get:
A 3
Name: A, dtype: int64
But now I want the counts of all the 4 columns. I've made the following script:
df[['A', 'B', 'C', 'D']].value_counts()
I want to get the output: A 3, B 2, C 1, D 3. But I only get the count of A, and not the other columns. What am I doing wrong here?