Quandl: US vs. EUR Exchange Rate

In this notebook, we'll take a look at data set , available on Quantopian. This dataset spans from 1999 through the current day. It contains the daily exchange rates for the US Dollar (USD) vs. the European EURO (EUR) We access this data via the API provided by Quandl. More details on this dataset can be found on Quandl's website.

Blaze

Before we dig into the data, we want to tell you about how you generally access Quantopian partner data sets. These datasets are available using the Blaze library. Blaze provides the Quantopian user with a convenient interface to access very large datasets.

Some of these sets (though not this one) are many millions of records. Bringing that data directly into Quantopian Research directly just is not viable. So Blaze allows us to provide a simple querying interface and shift the burden over to the server side.

To learn more about using Blaze and generally accessing Quantopian partner data, clone this tutorial notebook.

With preamble in place, let's get started:


In [5]:
# import the dataset
from quantopian.interactive.data.quandl import currfx_usdeur
# Since this data is public domain and provided by Quandl for free, there is no _free version of this
# data set, as found in the premium sets. This import gets you the entirety of this data set.

# import data operations
from odo import odo
# import other libraries we will use
import pandas as pd
import matplotlib.pyplot as plt

In [6]:
currfx_usdeur.sort('asof_date')


Out[6]:
asof_date rate high__est_ low__est_ timestamp
0 1999-09-06 0.941019 0.95269 0.92949 1999-09-06
1 1999-09-07 0.945500 0.95636 0.93476 1999-09-07
2 1999-09-08 0.944376 0.95588 0.93301 1999-09-08
3 1999-09-09 0.943697 0.95412 0.93339 1999-09-09
4 1999-09-10 0.948008 0.00000 0.00000 1999-09-10
5 1999-09-13 0.959838 0.97143 0.94838 1999-09-13
6 1999-09-14 0.964873 0.97623 0.95365 1999-09-14
7 1999-09-15 0.965378 0.97708 0.95382 1999-09-15
8 1999-09-16 0.963142 0.97393 0.95248 1999-09-16
9 1999-09-17 0.961971 0.00000 0.00000 1999-09-17
10 1999-09-20 0.960917 0.00000 0.00000 1999-09-20

The data goes all the way back to 1999 and is updated daily.

Blaze provides us with the first 10 rows of the data for display. Just to confirm, let's just count the number of rows in the Blaze expression:


In [7]:
currfx_usdeur.count()


Out[7]:
4240

Let's go plot it for fun. This data set is definitely small enough to just put right into a Pandas DataFrame


In [9]:
usdeur_df = odo(currfx_usdeur, pd.DataFrame)

usdeur_df.plot(x='asof_date', y='rate')
plt.xlabel("As Of Date (asof_date)")
plt.ylabel("Exchange Rate")
plt.title("USD vs. EUR Exchange Rate")
plt.legend().set_visible(False)



In [ ]: