上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 38 下一页
摘要: 1)以往的两个变量交换数据,是引入另外一个变量。但是python中可以。x,y=y,x;这样来进行数据的交换 2) 3)因为python里面关于浮点数类型的计算容易有误差: 比如在python中0.1+0.2=0.300000004他的数值与0.3并不相等。为了避免这种事情。我们引用一个类decim 阅读全文
posted @ 2020-08-04 09:57 喜欢爬的孩子 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 运行结果: 程序代码如下: #将excel中的数据进行读取分析 import openpyxl import numpy as np import math import matplotlib.pyplot as pit wk=openpyxl.load_workbook('信息11.xlsx') 阅读全文
posted @ 2020-08-03 09:04 喜欢爬的孩子 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 这个问题主要是在01背包上进行进行修改,添加一个一维数组: 代码如下: #include<iostream> #include<cmath> #include<cstring> #include<vector> #include<algorithm> using namespace std; con 阅读全文
posted @ 2020-08-01 17:20 喜欢爬的孩子 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 代码如下: import requests import openpyxl import time from bs4 import BeautifulSoup #用于解析和提取网页数据的 lst=[]#列表 def send_request(id,page): url = 'https://www. 阅读全文
posted @ 2020-08-01 17:16 喜欢爬的孩子 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 详情查看下面的代码: 如果被识别就要添加一个cookie如果没有被识别的话就要一个user—agent就好了。如果出现乱码就设置编码格式为utf-8 #静态的数据一般在elements中(复制文字到sources按ctrl+f搜索。找到的为静态),而动态去network中去寻找相关的信息 impor 阅读全文
posted @ 2020-07-31 20:51 喜欢爬的孩子 阅读(1028) 评论(0) 推荐(0) 编辑
摘要: 这次主要是爬了京东上一双鞋的相关评论:将数据保存到excel中并可视化展示相应的信息 主要的python代码如下: 文件1 #将excel中的数据进行读取分析 import openpyxl import matplotlib.pyplot as pit #数据统计用的 wk=openpyxl.lo 阅读全文
posted @ 2020-07-30 16:57 喜欢爬的孩子 阅读(1370) 评论(1) 推荐(0) 编辑
摘要: 具体代码如下: import requests import re headers = {'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74. 阅读全文
posted @ 2020-07-29 20:06 喜欢爬的孩子 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 简单的一下:只爬取一个页面上的(可以爬取多个页面)用到了拼接format以及list的遍历的等等小的知识点 import requests import re #下面这个就是伪装成浏览器正常访问浏览器 headers = {'user-agent':'Mozilla/5.0 (Windows NT 阅读全文
posted @ 2020-07-29 19:03 喜欢爬的孩子 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 分组背包: #include<iostream> #include<cmath> #include<cstring> #include<algorithm> using namespace std; int n,m; const int N=105; int f[N],v[N],w[N]; int 阅读全文
posted @ 2020-07-29 19:01 喜欢爬的孩子 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 首先是01背包的算法代码: #include<iostream> #include<cmath> #include<cstring> #include<algorithm> using namespace std; const int N=1005; int f[N]; int v[N],w[N]; 阅读全文
posted @ 2020-07-27 18:00 喜欢爬的孩子 阅读(118) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 38 下一页