Back to Community
Help Getting Started

Hi Quantopian peeps,

Sorry for a newbie question, but I'm trying to get some rudimentary things working.

I'm trying to plot some line charts with tsplot, but am stuck here:

syms = symbols(['AAPL', 'IBM', 'MSFT', 'SBUX', 'SPY'])  
aapl, ibm, msft, sbux, spy = syms  
df = get_pricing(syms)['price']

import pandas as pd

melted_df = pd.melt(df, var_name='Security', value_name='Price') # melts the dataframe, but not to a point where I can feed it to sns.tsplot

#melted_df = pd.melt(df, id_vars='index', var_name='Security', value_name='Price') # can't get this to work

sns.tsplot(melted_df, time='Datetime', value='Security', condition='Price') # end goal  

Any ideas how I can get over this hurdle?

This works:

Is it better to add more timeseries data to the dataframe and plot it using dataframe's plot vs massaging everything to fit into seaborn's tsplot?

Thank you for your time!