![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
迷麟Milin
There isn't time, so brief is life, for bickerings, apologies, heartburnings, callings to account. There is only time for loving, and but an instant, so to speak, for that. The good life is built with good relationships.
——Mark Twain
展开
-
python作图语法
Python作图语法基本语法plt.show()作用:绘制此前设置好的图像plt.title()作用:设置图表标题示例:plt.title(“This is a title”, fontsize=24)plt.xlabel()作用:设置x轴标签示例:plt.xlabel(“x_value”, fontsize=14)plt. scatter()作用:绘制一个点(x...原创 2020-01-19 10:26:37 · 493 阅读 · 0 评论 -
Context Attentive Document Ranking and Query Suggestion
AOL数据集文档结构如图1所示图1 文档结构使用说明:处理思路:data_process.py运行报错与修改方法修改方法:train_v2.1,dev_v2.1,test_v2.1.json——json文件的格式不对具体表现为文件的最后一行内容残缺,将其删除之,debug成功...原创 2019-11-19 22:03:14 · 358 阅读 · 2 评论 -
python自动给数字前面补0的方法
转 python自动给数字前面补0的方法 2016年02月27日 10:57:26 huludan 阅读数:28744 ...转载 2019-05-11 11:35:14 · 1793 阅读 · 0 评论 -
python 爬取网页title 并行 bs4 beautifulsoup4
预先准备:python3、beautifulsoup4、bs4、内存较大的服务器项目结构如下图所示:思路:为了爬取个数达百万级别的url的title,如果每个网页的延迟设置为1秒、串行爬取,大概消耗的时间将达数十万秒乃至数百万秒。而一天仅有8万多(86400)秒,不可接受!因此,我们采用并行的方法,利用url_distract_into_txts.py将存...原创 2019-05-06 20:47:20 · 2401 阅读 · 0 评论 -
tensorflow报错:Failed to load the native TensorFlow runtime.
CPU版tensorflowimport tensorflow as tfpycharm报错如下:Failed to load the native TensorFlow runtime.原因:未更新tensorflow的版本解决办法如下:1.打开anaconda,切换到tensorflow对应的python终端,比如py35(默认为base)2.输入pip...原创 2019-03-27 22:44:57 · 15275 阅读 · 0 评论 -
Tensorflow算法设计、训练的核心步骤
tensor意为张量,tensorflow通过tensor来进行一系列的操作每运行一个模块需要创建一个新的InteractiveSession,不同的session之间的数据和运算相互独立sess = tf.InteractiveSession() # 定义一个default的会话,每个会话相互独立,每个模型在一个会话中运行x = tf.placeholder(tf.fl...原创 2019-03-30 22:12:15 · 618 阅读 · 0 评论 -
Python异常处理 10-7 加法计算器
python异常处理语法:try: statement(s)except Exceptation_class_name: statement(s)可以类比C++的try-catch异常处理示例:10-7 加法计算器while True: number = input("Enter a number:") number_2 =...原创 2019-03-03 20:32:10 · 1234 阅读 · 0 评论 -
Python 类与继承 9-9电瓶升级
9-9 电瓶升级class Car(): def __init__(self, make, model, year): self.make = make self.model = model self.year = year self.read = 0 def describe(self): l...原创 2019-03-02 20:42:10 · 396 阅读 · 0 评论 -
python enumerate用法总结
https://blog.csdn.net/churximi/article/details/51648388翻译 2019-03-01 21:43:43 · 314 阅读 · 0 评论 -
Python 如何使用列表
可类别C++中的数组,初始化,赋值、增删改、get元素个数a = [] # definition of list afor i in range(1, 9): # for loop to append a value to list a in the end a.append(i)print(a)while len(a) > 5: a.pop() # ...原创 2019-02-27 21:52:29 · 557 阅读 · 0 评论