Closed brucemontegani closed 3 years ago
That works for me, thanks. there's also another recent solution added in Issues.
As I said in #3:
This line before the loop will clear out any rows that contain null data in any column:
hqm_dataframe.dropna(inplace=True)
@subnivean solution seems to be the most straightforward fix to this issue.
@subnivean has solved this, so i am closing the issue.
If any of the values in the One-Year, Six-Month, Three-Month, One-Month Price Returns is 'None' then the 'percentileofscore' function will error because it cannot match a float against a NoneType.
To fix this I added the following in the creation of the data series for each price return column. xxx is the time period:
float(0 if data[symbol]['stats']['xxxChangePercent'] is None else data[symbol]['stats']['xxxChangePercent'])
I am not sure if there is a better solution.