摘要: codeforces1040A Palindrome Dance A group of nn dancers rehearses a performance for the closing ceremony. The dancers are arranged in a row, they've st 阅读全文
posted @ 2018-10-24 16:12 cqdef_xxx 阅读(296) 评论(0) 推荐(0) 编辑
摘要: codeforces466C Number of Ways You've got array a[1], a[2], ..., a[n], consisting of n integers. Count the number of ways to split all the elements of 阅读全文
posted @ 2018-10-20 22:04 cqdef_xxx 阅读(227) 评论(0) 推荐(0) 编辑
摘要: codeforces158B Taxi codeforces158B Taxi After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his bir 阅读全文
posted @ 2018-10-20 11:45 cqdef_xxx 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 因为这章实在也没什么好做笔记的, 因为“Item对象是用于收集抓取数据的简单容器。它们提供类似字典的 API”,我的能力也不足,这里就直接贴上官方的原文翻译了。 物品 抓取的主要目标是从非结构化源(通常是网页)中提取结构化数据。Scrapy蜘蛛可以像Python一样返回提取的数据。虽然方便和熟悉,但 阅读全文
posted @ 2018-10-16 20:22 cqdef_xxx 阅读(2479) 评论(0) 推荐(0) 编辑
摘要: Scrapy shell Scrapy shell是一个交互式shell,您可以非常快速地尝试调试您的抓取代码,而无需运行蜘蛛。它用于测试数据提取代码,但您实际上可以使用它来测试任何类型的代码,因为它也是常规的Python shell。 配置 官方原文:如果安装了IPython,Scrapy she 阅读全文
posted @ 2018-10-14 21:58 cqdef_xxx 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 命令行工具 创建项目 scrapy startproject myproject [project_dir] 在命令行中创建项目 E:\pythoncode中创建myproject项目 接下来 按:如果project_dir没有指定,project_dir将是相同的myproject 控制项目 例如 阅读全文
posted @ 2018-10-07 23:40 cqdef_xxx 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 如果python使用numpy创建多维数组会比较简单 但是不用numpy呢? 二维数组的创建: 3行10列的二维数组的创建: 或者 我们来检查一下数组创建的对不对 没有输出error有关的东西,正确! 三维数组的创建: 4行3列,Z=2的三维数组的创建: 或者 检查: 没有输出error有关的东西, 阅读全文
posted @ 2018-07-22 15:50 cqdef_xxx 阅读(17334) 评论(0) 推荐(0) 编辑
摘要: 第一种用法 np.where(conditions,x,y) if (condituons成立): 数组变x else: 数组变y import numpy as np ''' x = np.random.randn(4,4) print(np.where(x>0,2,-2)) #试试效果 xarr 阅读全文
posted @ 2016-12-03 18:24 cqdef_xxx 阅读(24246) 评论(0) 推荐(0) 编辑
摘要: 当在你的某个文件夹中打开xxx.py的时候(引用numpy的py文件) 、 阅读全文
posted @ 2016-12-01 21:48 cqdef_xxx 阅读(266) 评论(0) 推荐(0) 编辑
摘要: print(["good","bad"][1]) #这句话的意思就是输出bad,如果[1]改为[0]就是输出good 接下来是变形时刻 print(["good","bad"][1<2]) #输出bad print([1,2,3][2]) #输出3 意思就是这样 l=[[1,2,3][1],[1][0]]print(l) data = sorted(list(map(in... 阅读全文
posted @ 2016-11-27 21:32 cqdef_xxx 阅读(322) 评论(0) 推荐(0) 编辑