In [1]:
import pandas as pd
from beakerx import *
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
In [2]:
prices=pd.read_csv("data/price.csv", index_col=0, header=0, parse_dates=True)
In [3]:
SimpleTimePlot(prices, prices.keys())
In [4]:
from pyutil.timeseries.merge import *
In [5]:
ts = prices["A"]
In [6]:
ts.tail(5)
Out[6]:
In [7]:
to_date(ts).tail(5)
Out[7]:
In [8]:
to_datetime(ts).tail(5)
Out[8]:
In [9]:
first_index(ts)
Out[9]:
In [10]:
first_index(to_date(ts))
Out[10]:
In [11]:
last_index(to_date(ts))
Out[11]:
In [12]:
SimpleTimePlot(np.log(prices["A"]).diff().dropna().to_frame("returns"), ["returns"])
In [13]:
from pyutil.timeseries.signal import *
In [14]:
SimpleTimePlot(prices["A"].to_frame("price"), ["price"])