In [1]:
from quantopian.pipeline import Pipeline
In a new cell, let's define a function to create our pipeline. Wrapping our pipeline creation in a function sets up a structure for more complex pipelines that we will see later on. For now, this function simply returns an empty pipeline:
In [2]:
def make_pipeline():
return Pipeline()
In a new cell, let's instantiate our pipeline by running make_pipeline()
:
In [3]:
my_pipe = make_pipeline()
In [4]:
from quantopian.research import run_pipeline
Let's run our pipeline for one day (2015-05-05) with run_pipeline
and display it. Note that the 2nd and 3rd arguments are the start and end dates of the simulation, respectively.
In [5]:
result = run_pipeline(my_pipe, '2015-05-05', '2015-05-05')
A call to run_pipeline
returns a pandas DataFrame indexed by date and securities. Let's see what the empty pipeline looks like:
In [6]:
result
Out[6]:
The output of an empty pipeline is a DataFrame with no columns. In this example, our pipeline has an index made up of all 8000+ securities (truncated in the display) for May 5th, 2015, but doesn't have any columns.
In the following lessons, we'll take a look at how to add columns to our pipeline output, and how to filter down to a subset of securities.