摘要: 合并段落:将以非法段落结束符结束的段落和下一段落进行合并,并去掉空白行和段落首尾的空白字符。def isEndOfP(line): notendstrs = ["www.", "文章"] for notendstr in notendstrs: ... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(1173) 评论(0) 推荐(0) 编辑
摘要: 极坐标方程:ρ=a(1−sin⁡θ)\rho = a (1-\sin\theta)ρ=a(1−sinθ)极坐标画图:%matplotlib inlineimport matplotlib.pyplot as pltimport numpy as npthet... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(2858) 评论(0) 推荐(0) 编辑
摘要: 每次调用session_maker()都会返回一个新的session对象,两次调用返回的session对象不同。在一个线程中,多次调用scoped_session()返回的session对象是一个,类似单例模式。但是在不同线程中调用scoped_sessio... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(522) 评论(0) 推荐(1) 编辑
摘要: 在ipython notebook 或 Jupyter 下使用matplotlib画图:%matplotlib inlineimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axe... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 安装:pip install -U scikit-learn数据标准化from sklearn import preprocessinga = np.array([[10, 2.7, 3.6], [-100, 5, -2], ... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 安装:pip install ipythonpip install "ipython[notebook]" #或者pip3 install ipython[all]#用浏览器即时运行调试代码ipython notebook修改启动默认目录:jupyter ... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(1495) 评论(0) 推荐(0) 编辑
摘要: 安装:pip install sqlalchemy# 安装数据库驱动:pip install pymysqlpip install cx_oracle举例:(在url后面加入?charset=utf8可以防止乱码)from sqlalchemy import... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(1605) 评论(0) 推荐(0) 编辑
摘要: 定义一个df:dates = pd.date_range('20180101', periods=6)df = pd.DataFrame(np.arange(24).reshape(6, 4), index=dates, columns=['A', 'B',... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(1658) 评论(0) 推荐(0) 编辑
摘要: import numpy as npimport pandas as pds = pd.Series([1,3,6, np.nan, 44, 1]) #定义一个序列。 序列就是一列内容,每一行有一个index值print(s)print(s.index)0 ... 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(300) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/red_stone1/article/details/73380517转为markdown那里,md参数要改为markdown 阅读全文
posted @ 2018-12-26 09:27 xuejianbest 阅读(1129) 评论(0) 推荐(0) 编辑