Java, Joe, Coffee, Café? All of the Above!

Sashank Gummella
Posted on May 12, 2019


The world runs on coffee. For years tea used to be the popular caffeinated beverage of choice in many cultures, but coffee seems to have taken its place. Global production and consumption of coffee has increased steadily over the last two decades. This Shiny app, Coffee Beans, presents informative and interactive visualizations of these trends. Code for the project can be found in the tab titled Github Repository


This 3D interactive global map let’s the user select which harvest year she would like to observe. She can then move around the map and hover over different countries to view their statistics. The text in the hoverbox displays harvest month, total production, domestic consumption, exportable production and gross opening stocks. These numbers help in describing not only how much coffee was produced, but also how much was consumed domestically. These numbers are graphed against time in the following tab, Time Series.

Time Series

This tab presents two different time series plots. One shows how a selected statistic, such as total production, for a selected country varies from 1990 to 2017. Accompanying this plot are two info-boxes that display the years with the highest and lowest values for the chosen statistic and country. Since statistics like total production, domestic consumption, exportable production, and gross opening stocks vary greatly among the countries, I decided it was necessary to depict domestic consumption, exportable production and gross opening stocks with respect to total production. These resultant ratios of statistic to total production gives us more insight into individual countries’ relationships with coffee. Some may cultivate to export more since their economy may be dependent on revenue streams from coffee sales. Some countries’ citizens’ daily habits may include consuming more, or coffee can be a big seller among visiting tourists if a country is known to have great tasting coffee.

The pictures below show that domestic consumption and total production have grown considerably for Brazil, a major player in the coffee business. The fluctuation in the total production tells us that in certain years Brazil tapped into its gross opening stocks to meet market demand for coffee rather than cultivating more coffee beans. This may have happened in order to cut production costs.

The second plot depicts global moving averages. From the input box, a user may select from mean total production, mean domestic consumption, mean exportable production, and mean gross opening stocks and see how they change from 1990 to 2017. The pictures below track mean total production and mean domestic consumption over a three-decade period.


I have observed that South American, Caribbean, and some Central American nations have been consuming more coffee domestically over the last couple of decades. As a result, most of those nations have exported less in 2017 compared to in 1990. Brazil was able to offset this deficit by producing more coffee.

South America used to be the biggest player in coffee production. In Africa, nations have been producing more coffee to export in the last couple of decades. Countries, such as Ghana, Zambia, Togo have either raised exportable production or maintained high export over this time period.

Countries in South America, Africa, and Asia are producing much more coffee to meet higher domestic consumption demands. Asian countries, in which tea is very popular, such as India, Indonesia, and Thailand have been seeing increased domestic consumption in coffee. A gradual but steady rise in coffee exports and consumption has been noted in countries of this region of the world. These trends would be worth exploring to see how this has affected those citizens’ relationships with tea.

Future Work

My next step for this project would be to merge datasets detailing coffee imports to see how coffee is distributed globally. An imports dataset that tells me where countries are importing their coffee from would give insight into the economies of coffee producing countries and help in explaining global trends, such as, why some countries consume less than others. Another interesting thought to explore is how much of a country’s GDP is centered around coffee-related businesses. An analysis of this may present opportunities to invest in like, perhaps, pastry shops or a snack business that pairs well with the local cup of Joe.

Thanks for reading!

About Author

Sashank Gummella

Sashank Gummella

Sashank graduated from the University of Illinois in May of 2018 with a Bachelor of Science degree in Aerospace Engineering. He's had the privilege of interning at NASA Langley Research Center, where he was involved with the design...
View all posts by Sashank Gummella >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp