World Food Production Descriptive Analysis in Python
Introduction
In this article, I would like to share my work on doing descriptive analysis on World Food Production data. The main purposes of this article are to demonstrate descriptive analysis with Python, and get some general insights from the data.
Some questions for this descriptive analysis are :
- what are the highest commodities produced by the world ?
- what are the highest commodities produced by particular country ?
- how is the trend of amount of commodities produced by particular country (Indonesia) ?
- what are the most productive countries for producing particular commodity (rice) ?
Data
The data is taken from https://www.kaggle.com/dorbicycle/world-foodfeed-production. This data have several columns, which in general describe countries, Items, food or feed category, and amount of productions from year 1961 to 2013.
Descriptive Analysis
Data reading
pandas read_csv function is used to read the dataset file. This function return a dataframe object. As described in the data webpage, it need read with encoding ‘latin1’, so I it need parse as parameter.
df = pd.read_csv('FAO.csv', encoding='latin1')
After that, we can see some samples of the data by using head function
df.head(3)
The table contains data of country, Items (commodities), Element (Food or Feed) and amount of production from year 1961 to 2013.
Below some data description through visualization. Full code can be viewed in this jupyter notebook file
From above graph, we can easily see the 10 highest commodities in the world. ‘Cereals-Excluding Beer’ is the highest commodity, followed by ‘Milk-Excluding Butter’ and ‘Vegetables’ with around 3/4 and 1/3 amount of ‘Cereals-Excluding Beer’. ‘Starchy Roots’, ‘Maize and products’, ‘Vegetable’, ‘Wheat and products’ have almost the same amount, and so on.
We also can see the highest commodity in particular country (in this case, Indonesia). In Indonesia, the highest commodity is ‘Cereals-Excluding Beer’, followed by ‘Rice’ (around 3/4 amount of Cereals), ‘Starchy Roots’ (around 1/2 amount of Rice), ‘Cassava and products’, and ‘Fruits-Excluding Wine’
In above graph, we can see the trend of 5 highest commodities in Indonesia. For ‘Cereals-Excluding Beer’, the production is increasing almost in every year, except in 1990 and 1996. For Starchy Roots, the number of production is tend to constant.
we also can see the most productive countries for particular commodity (in this case, Rice). China, India, and Indonesia are the 3 highest countries produces rice. China and India have significantly high amount for producing rice compare to other countries.
Conclusion
Through data visualization, we can do descriptive analysis and get some general knowledges of our data.