Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Is there a way to quickly grab sample data and avoid waiting 1m running the pipeline?

The tutorial has this code to run a pipeline, but I would just like to poke around at what the output columns look like for one ticker and one date, without having to wait the 1m it takes for a pipeline to finish running, something like:

print USEquityPricing.close.latest but it just returns Latest([EquityPricing.close], 1)

Is there any way to somehow pass in a much smaller data to compute, say one ticker and one date, and see the results immediately? Ideally I would be able to iterate quickly and build out the code I want for make_pipeline, and then use the pipeline to parallelize fetching data on my ticker universe and dates

Tutorial code:

# Import Pipeline class and datasets  
from quantopian.pipeline import Pipeline  
from quantopian.pipeline.data import USEquityPricing  
from quantopian.pipeline.data.psychsignal import stocktwits

# Import built-in moving average calculation  
from quantopian.pipeline.factors import SimpleMovingAverage

# Import built-in trading universe  
from quantopian.pipeline.experimental import QTradableStocksUS

# Import run_pipeline method  
from quantopian.research import run_pipeline

def make_pipeline():  
    # Create a reference to our trading universe  
    base_universe = QTradableStocksUS()

    # Get latest closing price  
    close_price = USEquityPricing.close.latest

    # Calculate 3 day average of bull_minus_bear scores  
    sentiment_score = SimpleMovingAverage(  
        inputs=[stocktwits.bull_minus_bear],  
        window_length=3,  
    )

    # Return Pipeline containing close_price and  
    # sentiment_score that has our trading universe as screen  
    return Pipeline(  
        columns={  
            'close_price': close_price,  
            'sentiment_score': sentiment_score,  
        },  
        screen=base_universe,  
    )

# Execute pipeline created by make_pipeline  
# between start_date and end_date  
pipeline_output = run_pipeline(  
    make_pipeline(),  
    start_date='2013-12-11',  
    end_date='2013-12-31'  
)

# Display last 10 rows  
pipeline_output.tail(10)  
1 response

If one wants to look at simply price and volume data then consider using get_pricing ( https://www.quantopian.com/help#quantopian_research_get_pricing) . That's very fast. However, if one wants any other data (eg sentiment as in the tutorial) then the only way to fetch that data is via a pipeline.

A word of caution if one chooses to use the get_pricing approach. Take time to understand how prices and volumes are adjusted differently between that method and using pipeline (https://www.quantopian.com/posts/price-mismatch-at-pipeline-and-get-pricing).

One can often speed up the response from the pipeline by defining a StaticAsset filter (https://www.quantopian.com/help#built-in-filters) and filter to just one or two stocks. Use this filter as a mask to any/all factors and classifiers being defined in the pipeline and then on the final screen. This is the way I typically work with the pipeline and response times are generally acceptable.

Consider using qgrid to parse the dataframe returned from the pipeline (https://www.quantopian.com/posts/qgrid-now-available-in-research-an-interactive-grid-for-sorting-and-filtering-dataframes). It doesn't impact the initial fetch of data but makes sorting and filtering the results very interactive.

Hope that helps a bit.