python学习
看不见我呀
坚持就是胜利
展开
-
重新看anaconda
http://www.cnblogs.com/xiaoming123abc/p/6970890.html自己总结一下哈:(1)其实conda是一个包管理器,通过conda的环境来控制不同的环境。(2)主要的应用的场合,有些人需要多环境的编译。(3)不同的环境,也就是不同的包,即不同的路径,管理不同的附加包。1.去官网下载Anaconda 下载地址 选择对应的你的系统版本,比如我的是win7-64位...转载 2018-07-09 19:51:36 · 364 阅读 · 0 评论 -
网络爬虫实例之一
from bs4 import BeautifulSoupfrom urllib.request import urlopenimport reimport randombase_url = "https://baike.baidu.com"his = ["/item/%E7%BD%91%E7%BB%9C%E7%88%AC%E8%99%AB/5162711"]for i in range...原创 2018-07-12 11:26:27 · 1925 阅读 · 0 评论 -
网络爬虫总结之一
(1)正则爬虫(1.1)打开网址from urllib.request import urlopen# if has Chinese, apply decode()html = urlopen( "https://morvanzhou.github.io/static/scraping/basic-structure.html").read().decode('utf-8')pr...原创 2018-07-12 11:23:56 · 737 阅读 · 0 评论 -
正则表达式总结
回忆几条正则的命令:(1)按照类型匹配如果需要找到潜在的多个可能性文字, 我们可以使用 [] 将可能的字符囊括进来. 比如 [ab] 就说明我想要找的字符可以是 a 也可以是 b.\d : 任何数字\D : 不是数字\s : 任何 white space, 如 [\t\n\r\f\v]\S : 不是 white space\w : 任何大小写字母, 数字和 “” [a-zA-Z0-9]\W : 不...原创 2018-07-12 11:06:14 · 143 阅读 · 0 评论 -
正则表达式
简单的匹配 正则表达式无非就是在做这么一回事. 在文字中找到特定的内容, 比如下面的内容. 我们在 “dog runs to cat” 这句话中寻找是否存在 “cat” 或者 “bird”.# matching stringpattern1 = "cat"pattern2 = "bird"string = "dog runs to cat"print(pattern1 in string)...转载 2018-07-11 16:51:47 · 177 阅读 · 0 评论 -
pandas
如果用 python 的列表和字典来作比较, 那么可以说 Numpy 是列表形式的,没有数值标签,而 Pandas 就是字典形式。Pandas是基于Numpy构建的,让Numpy为中心的应用变得更加简单。要使用pandas,首先需要了解他主要两个数据结构:Series和DataFrame。s = pd.Series([1, 2.0, np.nan, 7452])data = pd.date_ran...原创 2018-07-11 11:42:52 · 171 阅读 · 0 评论 -
关于numpy
(1)常见的属性a = np.array([[1,2,3], [5, 2, 5]])a.sizea.ndima.shape(2).创建数组np.ones((2, 4))np.array([[1, 2, 3], [3,4,5]])np.linspace(1, 12, 12).reshape((4, 3))(3)基本运算a = np.array([1, 2, 3])np.sin(a)print(a &...原创 2018-07-10 22:12:30 · 159 阅读 · 0 评论 -
multiprocessing_
https://morvanzhou.github.io/tutorials/python-basic/multiprocessing/多进程1.1 什么是 Multiprocessing1.2 添加进程 Process1.3 存储进程输出 Queue1.4 效率对比 threading & multiprocessing1.5 进程池 Pool1.6 共享内存 shared memory...原创 2018-07-10 17:56:31 · 176 阅读 · 0 评论 -
深度学习(莫烦Python基础:lecture 1)多线程 Threading
https://blog.csdn.net/malele4th/article/details/79460590原文:https://morvanzhou.github.io/learning-steps/多线程 Threading目录多线程 Threading目录1、什么是Threading2、添加线程Thread3、join功能4、存储进程结果 Queue5、GIL不一定有效率测试GIL(Gl...转载 2018-07-10 16:40:07 · 608 阅读 · 0 评论 -
python_multithread
1.首先是一个问题,有知道的请求讨论2.关于join的问题(join:不间断join中的线程)join(timeout=None) Wait until the thread terminates. This blocks the calling thread until the thread whose join() method is called terminates – either no...原创 2018-07-10 16:39:16 · 364 阅读 · 0 评论 -
matplotlib的实践莫烦python——Matplotlib
jupyter notebook没法复制,我直接上传把转载 2018-07-10 12:09:39 · 299 阅读 · 0 评论 -
Python-matplotlib画图(莫烦笔记)
https://www.zhihu.com/collection/260736383<此处就不自己写了,看了遍,照着写了一边,作者写的不错。不过有些有些偷懒,我只做了常见的功能>作者:触摸壹缕阳光链接:https://zhuanlan.zhihu.com/p/33270402来源:知乎著作权归作者所有,转载请联系作者获得授权。1.前言Matplotlib是一个python的 2D绘图库...转载 2018-07-10 12:07:24 · 173608 阅读 · 0 评论 -
python第一课(一些基础知识)
0.关于python的命名规则所谓”内部(Internal)”表示仅模块内可用, 或者, 在类内是保护或私有的.用单下划线(_)开头表示模块变量或函数是protected的(使用import * from时不会包含).用双下划线(__)开头的实例变量或方法表示类内私有.将相关的类和顶级函数放在同一个模块里. 不像Java, 没必要限制一个类一个模块.对类名使用大写字母开头的单词(如CapWords...原创 2018-07-09 21:59:54 · 185 阅读 · 0 评论 -
网络爬虫基础之二(requests)
备注:此部分内容整理自莫烦python从主动和被动的角度来说, post 中文是发送, 比较主动, 你控制了服务器返回的内容. 而 get 中文是取得, 是被动的, 你没有发送给服务器个性化的信息, 它不会根据你个性化的信息返回不一样的 HTML.1.requests.get()功能import requestsimport webbrowserparam = {"wd": "莫烦Python...原创 2018-07-12 11:39:05 · 233 阅读 · 0 评论