Skip to content

Commit ea8f19b

Browse files
committed
Merge pull request scikit-learn#4595 from sseg/bicluster-example
[MRG+1] Change xrange function to range in bicluster newsgroups example
2 parents f3f0fa3 + 641bd93 commit ea8f19b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/bicluster/bicluster_newsgroups.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
from sklearn.cluster.bicluster import SpectralCoclustering
6767
from sklearn.cluster import MiniBatchKMeans
68-
from sklearn.externals import six
68+
from sklearn.externals.six import iteritems
6969
from sklearn.datasets.twenty_newsgroups import fetch_20newsgroups
7070
from sklearn.feature_extraction.text import TfidfVectorizer
7171
from sklearn.metrics.cluster import v_measure_score
@@ -143,11 +143,11 @@ def most_common(d):
143143
144144
Like Counter.most_common in Python >=2.7.
145145
"""
146-
return sorted(six.iteritems(d), key=operator.itemgetter(1), reverse=True)
146+
return sorted(iteritems(d), key=operator.itemgetter(1), reverse=True)
147147

148148

149149
bicluster_ncuts = list(bicluster_ncut(i)
150-
for i in xrange(len(newsgroups.target_names)))
150+
for i in range(len(newsgroups.target_names)))
151151
best_idx = np.argsort(bicluster_ncuts)[:5]
152152

153153
print()

0 commit comments

Comments
 (0)