![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
AdaWong_Corner
another blog address: http://www.cnblogs.com/adawong/
展开
-
python2.x 与python3.x之d.keys()返回类型的区别
问题:python2.x 与python3.x之d.keys()返回类型的区别 TypeError: ‘dict_keys’ object does not support indexingtype(myTree)#dict#python2.x when d.keys() 返回list类型,可直接使用索引获取其元素myTree.keys()[0]#python3.x dict.keys() 返原创 2017-09-21 19:55:08 · 5161 阅读 · 0 评论 -
python3.x 异常之TypeError & UnicodeDecodeError
TypeError: only length-1 arrays can be converted to Python scalars while trying to exponentially fit data 问题代码:p1Vect = math.log(p1Num/p1Denom)#TypeError: only length-1 arrays can be converted to Pyt原创 2017-09-29 20:49:15 · 827 阅读 · 0 评论