Computer scienceData scienceInstrumentsPandasData analysis with pandas

Summarizing categorical columns

Count countries

Report a typo

Here we have a sample from the dataset wine_sample:

wine_sample.head()

Output:

+----+-----------+----------+---------+
|    | country   |   points |   price |
|----+-----------+----------+---------|
|  0 | Argentina |       89 |      26 |
|  1 | Argentina |       88 |      24 |
|  2 | Argentina |       88 |      25 |
|  3 | Argentina |       87 |      18 |
|  4 | Argentina |       83 |      13 |
+----+-----------+----------+---------+

Use one pandas method to find how many times each country occurs in this sample. Store the result in countries_amount.

Write a program in Python 3
# your code here. The DataFrame is already loaded as wine_sample.

countries_amount = ...
___

Create a free account to access the full topic