- miles driven
- price/gallon at pump
- date
- where I filled up (city name)
- how much fuel my car said I used
- how much fuel the pump said I put in my car
- my average speed according to my car
I sold my car in 2017 and since then this spreadsheet has just been sitting there. I was traveling about 40 minutes one-way for work every day, so there are a lot of data points. Recently I’ve been looking into learning Tableau as a means of visualizing data and I figured this was as good a sample of data as any to cut my teeth on.
Cleaning the Data
The most obvious place to start is with the cost per gallon of fuel. So, plotting that up let's take a look:
Price per gallon for nearly every refueling over approximately 4 years.
|
There are other instances of this (especially in the summer and around winter when I usually travel to visit family). Fortunately, I can place some constraints on the data and remove all points that aren't associated with my hometown. I did this by first computing the latitude and longitude of each city where I fueled up in. Then I applied filters to select only those latitudes and longitudes around my hometown.
| Price per gallon for fuel restricted to only refuelings in my hometown |
That clears things up nicely! There are a few features in this distribution, most noticeable is the difference between winter and summer.
Next Up
In the next post, I'll dive a little deeper into the data and analyze the actual fuel trends that appear in the above image.- Part 2: Seasonal trends in fuel prices
No comments:
Post a Comment