The idea of this article is to explain in a basic way how to use Pandas to get financial data, in this case the value of the currencies of countries such as Argentina, Brazil, Chile, Mexico and Venezuela. Quandl is a financial and economic alternative data platform that serves professional investors. The Quandl API gives access to its data through the R language, Python, Matlab, Maple and Stata. More information on wikipedia (broken link) and on its site.

In this case the data will be accessed through Python and visualized with Pandas and matplotlib.

The Quandl information for the countries:

The process would be the following:

  1. Import libraries
  2. Access the countries' data in Quandl
  3. Sort the columns, remove NaN.
  4. Create a portfolio
  5. Visualize the data

You can see the codes to access the data, for example for Mexico, in the following image.

Quandl page with the Dollar information for Mexico

  1. Import the pandas, quandl and matplotlib libraries
  1. Define the start and end dates of the analysis
  1. Get data from quandl
  1. Visualize the Dicom and Dolar today data
  1. Create the portfolio that groups all the quotes
  1. Drop the NaN fields and rename the columns
  1. Plot all the quotes
  1. Plot for Argentina
  1. Plot for Brazil
  1. Plot for Chile
  1. Plot for Mexico
  1. Plot for Venezuela
  1. Dicom and Dolar Today plots separately

You can see the complete notebook at:
ecrespo/articulos-cienciadedatos Contribute to articulos-cienciadedatos development by creating an account on GitHub.github.com

Make a donation! If you liked the article you can make a donation with Bitcoin (BTC) using the digital wallet of your choice to the following address: 17MtNybhdkA9GV3UNS6BTwPcuhjXoPrSzV

Or by scanning the QR code from your wallet:

17MtNybhdkA9GV3UNS6BTwPcuhjXoPrSzV