[Tutor] Problem understanding the asarray function of numpy

Radhika Gaonkar radhikag992 at gmail.com
Thu Sep 11 15:34:32 CEST 2014


I have an implementation of lsa, that I need to modify. I am having some
trouble understanding the code. This is the line where I am stuck:

DocsPerWord = sum(asarray(self.A > 0, 'i'), axis=1)

The link for this implementation is :
http://www.puffinwarellc.com/index.php/news-and-articles/articles/33-latent-semantic-analysis-tutorial.html?showall=1

Here, A is a matrix of size vocabulary_Size X number_ofDocs
As far as the documentation of asarray is concerned, this should return an
array interpretation of the matrix A. But, we need to sum each row. What is
happening here?

Thanks!
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140911/69fd4b50/attachment.html>


More information about the Tutor mailing list