In [1]:
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
%matplotlib inline
In [2]:
pwd
Out[2]:
In [3]:
from tedutil import isozygio
In [4]:
db = '/home/tedlaz/python_work/tedutil/gasbah1.sql3'
sql = """select logistiki_tran.imnia as dat, substr(logistiki_lmo.code,1,2) as lmo, logistiki_tran_d.xr, logistiki_tran_d.pi
from logistiki_tran_d
inner join logistiki_tran on logistiki_tran.id=logistiki_tran_d.tran_id
inner join logistiki_lmo on logistiki_lmo.id=logistiki_tran_d.lmos_id
Where logistiki_lmo.code like '%'"""
aa, stt = isozygio.arr(db, sql, 'm3')
In [5]:
pd.set_option('display.notebook_repr_html', True)
pd.set_option('display.max_columns', 100)
pd.set_option('display.max_rows', 1000)
pd.set_option('display.width', 5000)
pd.set_option('display.mpl_style', 'default') # Make the graphs a bit prettier
plt.rcParams['figure.figsize'] = (15, 7)
In [6]:
asd = pd.DataFrame(aa)
asd.columns = stt
asd.set_index('Lmoi', inplace=True)
asd.index.name = None
asd = asd.replace('-', 'NaN', regex=True).astype('float')
asd.T.plot(kind='bar')
Out[6]:
In [7]:
np.random.seed(111111)
s = pd.Series(np.random.randn(1096), index=pd.date_range('2012-01-01', '2014-12-31'))
walk_ts = s.cumsum()
pd.options.display.mpl_style = 'default'
walk_ts.plot()
Out[7]:
In [8]:
aa = pd.Series([100, 200, 300, 200, 100], index=['2011', '2012', '2013', '2014', '2015'])
aa
Out[8]:
In [ ]: