Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Why all the nan's

I'm trying to implement bollinger bands with pipeline.

When I return and log my pipeline output, most of my results are nan, why is that?

2 responses

Hello Manik,

All these nan results are because base_universe set is to the Q1500US and you're using base_universe as a mask in std_dev and mean_20. Most of those results are from stocks which aren't part of Q1500US list and are printed as nan. If you delete base_universe filter and mask, then results look like this:

Equity(2 [ARNC]) 15.790 13.659881 False
Equity(21 [AAME]) 2.060 1.922793 False
Equity(24 [AAPL]) 329.720 317.240759 False
Equity(25 [ARNC_PR]) 75.000 70.730008 False
Equity(31 [ABAX]) 27.120 26.727410 False
Equity(37 [ABCW]) 1.240 1.087551 False
Equity(39 [DDC]) 11.750 9.933782 False
Equity(41 [ARCB]) 27.930 26.173159 False
Equity(51 [ABL]) 6.880 4.278656 False
Equity(52 [ABM]) 26.650 22.727176 False
Equity(53 [ABMD]) 9.780 8.332186 False
Equity(58 [SERV]) 2.250 2.145220 False
Equity(62 [ABT]) 47.810 46.659560 False
Equity(64 [ABX]) 52.580 50.774199 False

I see, thank you