floating point - Fastest way to compare float64 in python with or without accuracy -


note: - accuracy not required in use case

i have big list of float64 name "cosine_similar" [ around 2 million elements , each between float64(0) , float64(1)]

from list , need create list name "similar_products" each element should greater float64(.970)

is there faster way

threshold_limit = float64(.970) similar_products = []  x in xrange(0,cosine_similar.__len__()):     if cosine_similar[x] > threshold_limit:         similar_products.append(cosine_similar[x]) 

if wondering cosine_similar list , here

sklearn.metrics.pairwise.cosine_similarity 


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -