![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python编程
一个biu
这个作者很懒,什么都没留下…
展开
-
Python Matplotlib
1、scatter函数函数原型:2.原创 2018-03-09 10:46:40 · 140 阅读 · 0 评论 -
Python Numpy
1. numpy.wherenumpy.where(condition[, x, y])Return elements, either from x or y, depending on condition.If only condition is given, return condition.nonzero().Parameters:condition : array_like, boolWh...原创 2018-03-09 10:48:35 · 114 阅读 · 0 评论 -
python_request返回中文乱码
POST从网页中获取数据,由于编码问题,出现乱码。方法:```response = session.get('http://xxxx')print(response.encoding)response.encoding = 'utf-8'print(response.json())```原因:1.因为数据源的编码声明不规范,导致 reuqests 无法判断出返回数据的正确编码,从而使用了它的默认编...转载 2018-04-27 11:05:37 · 19090 阅读 · 0 评论 -
Python通过正则表达式去除(过滤)或者替换HTML标签
本文实例介绍了Python通过正则表达式获取,去除(过滤)或者替换HTML标签的几种方法,具体内容如下python正则表达式关键内容:python正则表达式转义符:?12345678910111213. 匹配除换行符以外的任意字符\w 匹配字母或数字或下划线或汉字\s 匹配任意的空白符\d 匹配数字\b 匹配单词的开始或结束^ 匹配字符串的开始$ 匹配字符串的结束\W 匹配任意不是字母,数字,下划...转载 2018-04-27 13:08:49 · 18673 阅读 · 1 评论 -
string indices must be integers
在项目遇到一个错误 :TypeError: string indices must be integers由于是返回的接口数据,所以一时也分辨不出是哪里的错,然后我就还原了这样的场景:unicode_str = u'abcd'print unicode_str[2]print unicode_str['mykey']读取一个unicode编码的字符串的一个不存在的属性,见第三行,然后就会出现上面的...转载 2018-04-29 11:12:36 · 17366 阅读 · 0 评论