A quick look at fuel prices in Brazil

PUBLISHED ON NOV 3, 2019 — BOKEH, PANDAS, PYTHON

On this post I share a link to a dashboard depicting the fuel prices thoughout Brazil. The dataset used to generate the plots is provided by the brazillian government through ANP (Agência Nacional do Petróleo, Gás Natural e Biocombustíveis).

Fuel prices in Brazil


@jonathanborba


The dashboard is WIP and at the moment tries to address three questions:

  1. How do fuel prices vary, in average, among distributors?
  2. How do fuel prices vary, in average, between states?
  3. What is the average profit margin by state?

The dataset is modestly sized, with information about 554 municipalities, 252 distributors, 25459 fuel stations, and for a period between 2004 and 2018.

Some of the plots regarding NGV fuel may seem incomplete for different states. I can only suspect that either these states have not sold NGV in the past, or the dataset provided by ANP is missing data.

Also, and since DIESEL S10 was only introduced in 2013, the respective plots only show data for the period between 2013 and 2018.

The dashboard was written in Python, powered by Pandas and Bokeh, and rendered with Jinja into a Bootstrap styled single HTML file. Source code to be shared soon…

TAGS: BOKEH, PANDAS, PYTHON