Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
what is data?

Hello
I have done a visual representation of what 'data' is because i'm having some trouble understanding how it's done in order to understand the fundamental panel in the Piotroski score example.

i have the red axis (equities) as the keys of the panel, the orange axis (dates) as one axis and the green one as the other axis.
So basically the panel itself is the AAPL dataframe (top left of the image) repeated for every equity in my universe.
Is that correct?

https://www.dropbox.com/s/8uagqnyqhib1uff/data.png?dl=0

And actually what i have not understood is this:
If data contains all the equities (keys of the panel), and for all equities their SIDData (1 axis of the panel) and the second axis of the panel is the dates, why i get an error if i say for example:

data[context.security1]['1/1/2014']  

what i expect from this command is this:
1) data[context.security1] returns SIDData for my first equity: close_price, datetime, dt, get, high, low ecc...
2) ['1/1/2014'] specify the date for wich i want this SiDData.

So what i think is that data is indeed a panel, but the date axis is limited to 'Today' (like an horizontal slice in my image), and if i want to go back i use 'history command' that gives me a dataframe wich is like the data-panel but limited to the SIDData that i have request in the history command. (like a vertical slice in my image)

Thank you

2 responses

data is a dictionary containing your universe at that time, keyed by security ids. It will get updated every bar with the new universe (determined by pipeline, get_fundamentals, set_universe, or manual lookup).

For each security, it contains the following fields per bar:
- close_price
- high
- low
- open_price
- volume
- SIDData (sid, symbol, exchange, start_date,end_date)
- simple built-in transformations (mavg, stddev calculations)

Hope that helps!

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Thank you Alisa, i have uderstood too that data is a dataframe, but what is confusing me is that in this video at minute 33:30 when it comes to construct a fundamental panel to do the piotrosky score to handle historical fundamental data and do the comparison with last year values , the speaker says that ...'this panel is just like data wich is a panel too'.

So that's why i'm confused, maybe he is referring as data as a two dimensional panel (wich is infact a dataframe).. it's not very clear to me

Thank you for your help