We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 515f2f9 commit f1b0812Copy full SHA for f1b0812
ch04/wikitopics_plot.py
@@ -31,7 +31,7 @@
31
topics = np.load('topics.npy', mmap_mode='r')
32
33
# Compute the number of topics mentioned in each document
34
-lens = (topics > 0).sum(1)
+lens = (topics > 0).sum(axis=1)
35
print('Mean number of topics mentioned: {0:.3}'.format(np.mean(lens)))
36
print('Percentage of articles mentioning less than 10 topics: {0:.1%}'.format(np.mean(lens <= 10)))
37
0 commit comments