自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 收藏
  • 关注

原创 考研必备单词

list 45criterion标准refund the money for expired foods退还expired过期的expire到期,失效reimburse补偿,偿还shame羞耻sham虚伪,假冒sham jewellery仿造珠宝a sham battle模拟战trivial matters琐事trifling,petty不重要的tenant房客tent帐篷defic

2022-03-07 15:34:40 143

原创 英语外刊阅读

乌克兰总统Ukraine enters uncharted new era after comedian wins presidencyUkraine entered uncharted political waters on Monday after near final results showed a comedian with no political experience and few detailed policies had dramatically upended the status

2022-03-07 14:56:11 694

原创 修改dataframe的columns

列名的格式比较复杂,可以看出有四种情况:英文+\n+中文英文+\u2028+中文英文+\n+英文英文需要稍微进行一下处理便于后面的分析,有中文的保留中文部分,‘ALF\nALF’变成’ALF’,'PVD’保持不变。主要使用正则表达式进行匹配。## 原始列名列表col_names=list(data.columns)col=[]for i in range(len(col_names)): if re.findall(r"\u2028(.+)",col_names[i])!=[

2020-10-01 23:28:15 1007

原创 rgb

opencv读取之后,都需要用cvtColor从BGR转RGBmatplotlib.pyplot 读取后为rgb

2020-09-29 18:24:47 74

原创 dataframe某一列元素统计频数

import numpy as nplst=df['A'].values.tolist()dict(zip(*np.unique(lst, return_counts=True)))python zip()和zip(*)的区别可以看成是解压和压缩的区别,zip相当与压缩 zip(*)相当于解压。举例说明:x=[“a”,“1”]y=[“b”,“2”]z = list(zip(x,y))print (list(zip(x,y)))print (list(zip(*z)))结果为:[(

2020-09-20 10:41:25 2502

原创 matlab错题记

将某一列的最大值提出,用最大值减去该列每个元素。然后做复杂了就出了错应该是

2020-09-04 18:09:01 90

原创 scrapy爬取股票出错

stockscrapy项目中的stock.pyimport scrapyimport reclass StockSpider(scrapy.Spider): name = 'stock' #allowed_domains = ['http://quote.eastmoney.com'] start_urls = ['http://quote.eastmoney.com/stock_list.html'] def parse(self, response):

2020-05-22 09:35:49 172

原创 scrapy爬虫403错误

scrapy出错显示403错误,ip被禁,需要加入user-agentscrapy shell 'xxx_url' -s USER_AGENT='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'setting.py中需要加入user-agent参考原文...

2020-05-21 17:55:10 358

原创 泰坦尼克(机器学习逻辑回归)

泰坦尼克(机器学习逻辑回归)原文链接数据预处理import pandas as pdtrain=pd.read_csv('C:/Users/Admin/Downloads/train.csv')train.info()<class ‘pandas.core.frame.DataFrame’>RangeIndex: 891 entries, 0 to 890Data c...

2020-05-04 12:37:30 689

原创 urllib3+request+bs4+pandas+获取图书信息,入门笔记

出现warning需要ssl验证解决方法写入文件时出错解决方法json中dump和loads的区别urllib3import urllib3urllib3.disable_warnings()http=urllib3.PoolManager()#创建实例rq=http.request('GET',url='https://edu.tipdm.org/')print(rq.data...

2020-03-19 13:53:09 335

原创 用selenium和pandas获取新闻

selenium optionselenium获取属性获取属性值为get_attribute,获取文章为textfrom selenium.webdriver import Chromefrom selenium.webdriver.chrome.options import Optionsimport pandas as pdoptions = Options()# optio...

2020-03-19 05:57:11 260

原创 pandas解题

import pandas as pdfpath='C:/Users/Admin/Desktop/Grid_solar_EV_data.txt'pvuv=pd.read_csv(fpath,header=None)print(pvuv)C:\Users\Admin\Anaconda3\python.exe C:/Users/Admin/Desktop/尝试2.24/爬虫.py ...

2020-03-18 09:00:46 301

原创 日期相关问题(打印月历)

日期相关问题打印月历#include<stdio.h>int monthdays[2][13]={{0,31,28,31,30,31,30,31,30,31,30,31,30},{0,31,29,31,30,31,30,31,30,31,30,31,30}};int IsLeap(int y);int Value(int y,int m);void Draw(int y,i...

2020-03-12 11:53:28 286

原创 日期相关问题(n天以后问题)

当前计算机系统的日期#include<stdio.h>#include<time.h>int main(void){ time_t now,t1; t1=time(&now); printf("距离1970年1月1日0时的秒数,当前日历时间:%u\n",t1); struct tm *localtp; localtp=localtime(&...

2020-03-11 15:09:45 432

原创 洛谷,新手村,数组,珠心算测验

洛谷,新手村,数组,珠心算测验遇到难题,不知道怎么计算一个数组中不重复的元素的个数#include<stdio.h>int main(){ int n,i,j,k,left1,left2,count,z,ans,w,e,fin; int a[100]; int b[100]={0}; scanf("%d",&n); for(i=0;i<n;i++){...

2020-02-02 18:03:52 181

原创 C语言从入门到项目实战,第一次打代码,不知为何是错的

C语言从入门到项目实战反正错了,不知道为啥第220面内容#include <stdlib.h>#include <time.h>int Compute(int x,char op ,int y);int a,b;int main(void){ int n,k; char op; int a,b,ans,yans; ...

2020-02-01 14:50:29 146

原创 #洛谷,新手村,循环!循环!循环!计数问题(join,count)

洛谷,新手村,循环!循环!循环!计数问题答案n,x=map(int,input().split())b=[]for i in range(1,n+1): b.append(str(i))a=''.join(b)print(a.count(str(x)))注意count用于一个字符串中的小字符串的个数append用于列表,可直接加入一个数字,但是,该题中,要用到join,...

2020-01-16 16:17:05 192 1

原创 洛谷,新手村,‘循环!循环!循环!’,三连击

洛谷,新手村,‘循环!循环!循环!’,三连击解答for i in range(123,988): if (i*3)<988: c=i*3 b=i*2 a=i d=set() for j in str(a)+str(b)+str(c): d.add(j) ...

2020-01-12 15:23:38 91

原创 洛谷,新手村,顺序与分支,买铅笔

洛谷,新手村,顺序与分支,买铅笔我的解答n=int(input())c=[]import mathfor i in range(1,4): (x,y)=map(int,input().split()) b=math.ceil(n/x) cost=b*y c.append(cost)print(min(tuple(c)))题中我遇到的问题1 如何输入...

2020-01-12 15:23:26 152

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除