Python
闲敲棋子待归人
这个作者很懒,什么都没留下…
展开
-
Python正则表达式匹配反斜杠
在学习Python正则式的过程中,有一个问题一直困扰我,如何去匹配一个反斜杠(即“\”)?一、引入在学习了Python特殊字符和原始字符串之后,我觉得答案应该是这样的:1)普通字符串:’\’2)原始字符串:r’’但事实上在提取诸如“3\8”反斜杠之前的数字时,我屡次碰壁,始终得不到结果。最终发现自己理解错了,原来原始字符串和“正则转义”没有一点关系;下面详细谈一谈。二、字符串转义反斜...转载 2020-02-19 18:03:24 · 510 阅读 · 0 评论 -
Numpy中的广播
BroadcastingA set of arrays is called “broadcastable” to the same shape if one of the following is true:1.The arrays all have exactly the same shape.2.The arrays all have the same number of dimensi...原创 2020-02-17 00:34:27 · 328 阅读 · 1 评论 -
immutable and mutable type in Python
Mutable vs Immutable ObjectsIn general, data types in Python can be distinguished based on whether objects of the type are mutable or immutable. The content of objects of immutable types cannot be ch...原创 2020-02-16 03:30:47 · 589 阅读 · 0 评论