In this post, we will perform some simple exploratory analysis on the Brent Oil Prices dataset. We start by importing the pandas library and reading the data into a pandas data frame:
import pandas as pd
df = pd.read_csv("BrentOilPRices.csv")
We can also display the first five rows:
print(df.head())

Next, we can convert the ‘Date’ column into a datetime object and view the first five rows:
df['Date'] = pd.to_datetime(df['Date'])
print(df.head())

We can also view the last five rows of data:
print(df.head())

We can see from the data that the prices are from 1987–2019. We can also see that there are 8,216 rows of data. Next, we can plot the prices vs. time using the ‘seaborn’ data visualization package:
import seaborn as sns
sns.set()
plt.title('Brent Oil Prices')
sns.lineplot(df['Date'], df['Price'])

We can also look at the distribution of prices:

In the next post we will build a simple regression model to predict future Brent Oil prices. The code from this post is available on GitHub. Thanks for reading. Good luck and happy machine learning!