In this section, we will visualize some statistical properties of time series data used in financial analytics.
Performing financial analytics on time series data
Plotting returns
One of the classic measures of security performance is its returns over a prior period. A simple method for calculating returns in pandas is pct_change, where the percentage change from the previous row is computed for every row in the DataFrame.
In the following example, we use ABN stock data to plot a simple graph of daily percentage returns:
In [ ]:
%matplotlib inline
import quandl
quandl.ApiConfig.api_key = QUANDL_API_KEY
df = quandl.get('EURONEXT/ABN.4')
daily_changes = df.pct_change(periods=1)
daily_changes...