In [32]:
%pylab inline
import pandas as pd
import matplotlib.pyplot as plt
from utils import read_url, parse
In [35]:
SRC_FILE = 'http://ora600.ru:8080/data.csv'
#data = read_url(SRC_FILE).read()
df = pd.io.parsers.read_csv(SRC_FILE)
df = df.set_index(df.dt)
In [36]:
usd_buy = df.query("currency_from=='USD' & operation=='buy' & bank=='expobank'").rate
usd_sell = df.query("currency_from=='USD' & operation=='sell' & bank=='expobank'").rate
eur_buy = df.query("currency_from=='EUR' & operation=='buy' & bank=='expobank'").rate
eur_sell = df.query("currency_from=='EUR' & operation=='sell' & bank=='expobank'").rate
In [37]:
pd.options.display.mpl_style = 'default'
fig = plt.figure(figsize=(12, 6), dpi=80, facecolor='w', edgecolor='k')
usd_buy.plot()
usd_sell.plot()
eur_buy.plot()
eur_sell.plot()
plt.legend(['USD BUY', 'USD SELL', 'EUR BUY', 'EUR SELL'], loc=2)
fig.autofmt_xdate()
In [ ]: