Comment on My Python Code for the Netflix PrizeComments−tlocke14yI had a look though this and was confused by this line:ratings[ratings<1.0] = 1.0inhttps://github.com/alexbw/Netflix-Prize/blob/master/src/pred...Is it specific to NumPy? Or perhaps a Python trick I haven't seen before?−malkarouri14ySpecific to NumPy. Boolean indexing.http://www.scipy.org/Cookbook/Indexing#head-86055279f6592d36...−beambot14yYep. The indexing and slicing are quite powerful. For those familiar with MATLAB, this is a fantastic resource: http://www.scipy.org/NumPy_for_Matlab_Users−tlocke14yGot it, thanks for the info and pointers everyone.−jdleesmiller14yI believe that's an example of 'logical indexing', which is a useful feature in many vector-oriented languages / packages:http://blogs.mathworks.com/steve/2008/01/28/logical-indexing...
Comments
I had a look though this and was confused by this line:
ratings[ratings<1.0] = 1.0
in
https://github.com/alexbw/Netflix-Prize/blob/master/src/pred...
Is it specific to NumPy? Or perhaps a Python trick I haven't seen before?
Specific to NumPy. Boolean indexing.
http://www.scipy.org/Cookbook/Indexing#head-86055279f6592d36...
Yep. The indexing and slicing are quite powerful. For those familiar with MATLAB, this is a fantastic resource: http://www.scipy.org/NumPy_for_Matlab_Users
Got it, thanks for the info and pointers everyone.
I believe that's an example of 'logical indexing', which is a useful feature in many vector-oriented languages / packages:
http://blogs.mathworks.com/steve/2008/01/28/logical-indexing...