Skip to content

Commit fe6b9ea

Browse files
committed
fix defaultdict call
In Python 2.7, the current version fails with: $ python -c 'from collections import defaultdict; defaultdict(None)' Traceback (most recent call last): File "<string>", line 1, in <module> TypeError: first argument must be callable
1 parent 96436df commit fe6b9ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/feature_extraction/text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ def _count_vocab(self, raw_documents, fixed_vocab):
726726
vocabulary = self.vocabulary_
727727
else:
728728
# Add a new value when a new vocabulary item is seen
729-
vocabulary = defaultdict(None)
729+
vocabulary = defaultdict()
730730
vocabulary.default_factory = vocabulary.__len__
731731

732732
analyze = self.build_analyzer()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy