One - One Code All

Blog Content

python3 reduce未定义

Python   2014-03-05 21:56:15



问题:

name 'reduce' is not defined

解决:

from functools import reduce

原因:

在python 3.0.0.0以后, reduce已经不在built-in function里了


上一篇:pandas汇总和计算描述统计:统计函数sum求和
下一篇:python import 上级目录

The minute you think of giving up, think of the reason why you held on so long.