Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Cannot Convert Float NaN To Integer Quantopian Learn from the Experts Lecture 2

I'm using the code from the second video in the learn from the experts video series however whenever I run the plots for the sample dates i get the error "Cannot Convert float NaN to integer". However when i run it for 2018-01-04 to end date the plots generate perfectly.

All code detailing the error can be found under tearsheet results ,and directly above that.

3 responses

You can filter out NaNs by using math.isnan as the problem seems to be that the methodology used does not take NaN as inputs.

@Aaron Stone I know that the nan's are the problem the only thing I'm not understanding is where there coming from because I filtered out nan's in alphas ,and in factor_data_loadings, and returns

Traceback points to divmod((best_vmax - vmax) providing NaNs. I am not sure why, but perhaps the search for vmax did not converge on any results for at least one point in the date range?