Data - compare (, columns=None, selection='Adj Close')[source]

Get the relative performance of multiple equities.

New in version 0.5.0.


eq_dfs : list or tuple of DataFrame

Performance data for multiple equities over a consistent time frame.

columns : iterable of str, default None

Labels to use for the columns of the output DataFrame. The labels, if provided, should normally be the names of the equities whose performance is being compared.

selection : str, default ‘Adj Close’

Column containing prices to be compared. Defaults to ‘Adj Close’.


rel_perf : DataFrame

A DataFrame whose columns contain normalized data for each equity represented in eq_dfs. The initial price for each equity will be normalized to 1.0.


Each set of data passed in eq_dfs is assumed to have the same start and end dates as the other data sets.


import pynance as pn

eqs = ('FSLR', 'SCTY', 'SPWR')
eq_dfs = []
for eq in eqs:
    eq_dfs.append(, '2016'))
rel_perf =, eqs)