![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
5jerry
这个作者很懒,什么都没留下…
展开
-
python 字典转对象 dict to obj
借助python的方法:setattr(obj, name, value, /) 给obj对象设置name属性其值为value。Signature: setattr(obj, name, value, /)Docstring:Sets the named attribute on the given object to the specified value.setattr(x, 'y', v) is equivalent to ``x.y = v''Type: builti...原创 2020-11-14 17:52:43 · 657 阅读 · 0 评论 -
mxnet,nd中的asscalar()函数
X.asscalar()将向量X转换成标量,且向量X只能为一维含单个元素的向量X:nd类型的数据创建一个单个元素的向量test=nd.array([2])输出:[2.]<NDArray 1 @cpu(0)>转换成标量:test.asscalar()输出:2.0...原创 2019-10-23 20:38:43 · 7783 阅读 · 0 评论 -
python爬取html,反转义,双斜杠(\\)转换成单斜杠(\)字符被json正常解析
新手刚学py不久,用正则爬取数据的时候获得了一段json数据格式的段落,抓取回来的时候发现本身的文档已经是加了双反斜杠\\ 的字符串,这时候我用json.loads()格式化数据的时候出现错误,搞了我两天,参考了一下别人的资料,终于找到解决方法了搞定这个坑了,避免下次踩坑,先写下来。。。报错信息如下:json.decoder.JSONDecodeError: Expecting prop...原创 2018-01-17 17:33:04 · 23073 阅读 · 6 评论 -
在anaconda环境下使用pycharm console出现错误找不到指定模块DLL load fail err
报错:C:\Users\Dell\Anaconda3\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2018.3.2\helpers\pydev\pydevconsole.py" --mode=client --port=64760ImportError: DLL load failed解决方案:假...原创 2019-04-13 13:56:47 · 2897 阅读 · 1 评论