My aim is to perform some operations on the DataFrame returned by the Pipeline, but I am struggling to write most efficient code.
As I understand, Pipeline returns a MultiIndexed Pandas DataFrame (indexed on datetime and symbol) like this :
-----------------------------Equity (xyz1)
-----------------------------Equity (xyz2)
2015-11-01----------------Equity (xyz3)
-----------------------------Equity (xyz4)
-----------------------------Equity (xyz5)
Lets say I want to operate on a 10 day window on each stock, what is the most efficient way to do that? Using groupby(['symbol']).apply(lambda x : something) is too slow and iterating using .xs(symbol) seems redundant (using loops with pandas is a big no no).
Can someone point me to some resource where I can learn how to do operations on this MultiIndexed DataFrame returned by Pipeline?, particularly applying a function to data of each symbol.
I am fairly advanced with python, so pointing to snippets in zipline project will also work.