摘要:7.4 GUI的基本框架 常用组件 按钮 菜单 静态文本和文本 列表 单选框和复选框 布局管理(sizer)
阅读全文
摘要:6.2. pyplot作图1.折线图和散点图 t = np.arange(0,4,0.1) plt.plot(t,t,'o',t,t+2,t,t**2,'o') plt.show()2.柱线图 plt.bar(x,y)6.3. pylab作图同理 t = np.arange(0,4,0.1) pl.plot(t,t+2) pl.show()6.4.pa...
阅读全文
摘要:1.requests 获取 建立pd矩阵处理数据 pd.DataFrame(),pd.read_csv() 2.Webapi获取,如豆瓣API 3.NLTK语料库获取 5.4 数据选择 通过标签或者位置 djidf.code 或者djidf[‘code’] loc 通过标签来选择行或者列 也可以通过djid...
阅读全文
摘要:https://www.scipy.org/ 1. numpy 矩阵 2. matplotlib 绘图库 3. pandas 高效的Series和DataFrame数据结构4.5 ndarry .ndim#秩 .shape#维度 .size#元素个数 切片 运算 4.6 变长字典Se...
阅读全文
摘要:不重复,可对列表进行去重复处理 set(), frozenset() ,
阅读全文
摘要:1.生成字典 names = [] ,salaries = [] ,dict[zip(names,salaries)] dic = {key1:value1,key2:value2} dic = dict([[key1,value1],[key2,value2]]) dic = dict(([key1,value1],[key2,value2])) dic = ...
阅读全文
摘要:1. 获取网页r = requests.get(url) r.status_coder.text r.content r.json() r.encoding = ‘utf8’例子a.假设获取的是二进制文件,则可以借鉴如下方法保存数据:r = requests.get('http://www.baidu.com/img/bd_logo1.png',headers=headers)with o...
阅读全文
摘要:1. 文件的打开 with open(‘filename’ ,mode=’r’,buffering=1,…) as f: f.read() f.write() f.readline() f.readlines() f.writelines() f.seek(offset,wheace=0) f.se
阅读全文