自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 python按行写入和读取csv文件

这个方法适用于不希望有行标和列标的存取,如果需要的话可以直接用pandas。import csvx = ['1','2','3']with open('C:\学习资料\大二下\python数据分析\spider\printtest.csv','w',newline='') as f: writer = csv.writer(f) writer.writerows(x) #多行写入y = []path = 'C:\学习资料\大二下\python数据分析\spider\printte

2021-04-22 11:27:11 908 1

原创 python利用selenium/requests/bs4/xpath爬虫知网8516本学术期刊具体概要

因为这是python数据分析课的附加作业,所以想拿到分,历时好几天,解决了好多好多好多问题,终于按照老师要求爬出来了。先上效果图:之前爬虫纯小白的我,经历了requests→scrapy→selenium→selenium+requests→requests,最后发现这种作业级别的确实只用requests就够了。我会把每一步心路历程都写下来,因为不写下来怕以后自己忘记自己曾经为了一次作业这么拼过????...

2021-04-22 09:23:03 1200 1

原创 第3次

不使用pandas导入数据import csvpath = "C:\学习资料\大二下\python数据分析\作业\葡萄酒作业.csv"f = open(path, 'r', encoding="utf-8")# 去掉文件首行next(f)reader = csv.reader(f)conTent = []for con in reader: # 将reader中所有字符串型数字转换成数字类型,并加入conTent conTent.append(list(map(eval,.

2021-04-07 20:09:26 217 1

原创 第2次

result = []dic1 = {"名称" : "Requests", "功能" : "使用Apache2 licensed 许可证的HTTP库", "最新版本号" : "2.25.1", "官方网址" : "https://requests.readthedocs.io/en/master/"}result.append(dic1)dic2 = {"名称" : "Pandas", "功能" : "是一种快速,强大,灵活且易于使用的开源数据分析和处理工具", "最新版本号" : "1.2.3.

2021-04-07 20:06:40 104

原创 第1次

print("Hello!" + "陈菲")感兴趣的开发模块:(共6个)1. RequestsRequests库中有7个主要的函数分别是 request() 、get() 、 head() 、post() 、put() 、patch() 、delete() 。这七个函数中request()函数是其余六个函数的基础函数,其余六个函数的实现都是通过调用该函数实现的。方法说明requests.request() 构造一个请求,支撑一下方法的基础方法requests.get() 获取HTM.

2021-04-07 20:03:53 117

原创 C++中 string、char*、char、int的相互转换

1.string转换成char*1️⃣ data()方法string str = "hello world";const char *p = str.data(); //加const 或用 char *p = (char*)str.data(); 的形式注:若不加 const,编译时会报错:无法从 “const char*” 转换为 “char*”;2️⃣ c_str方法string str = "hello";const char *p = str.c_str(); //同上3️⃣c

2021-01-24 23:30:55 407

原创 3个学期结束的总结与寒假的大体计划

关于我的大一前一半在学校,后一半在家。应该是家中比较安静的学习环境给了我很大的帮助,让我能够静下心安排自己做想做的事,不想做的事(包括不想上的课)水过去就好。大一升大二的暑假一半时间在跟着导师参与项目,一半时间花在复习备考期末考上,结果还都不错,项目做的差不多,考试也拿了专业第一。大二上学期9月份的四级拿了603分,十二月份的6级感觉考的不是很理想,白浪费那么多时间去准备了。总体上,这学期课不多,但是为了一些所谓的综测能够加分的活动,多了很多无意义的忙碌。自己同时换了个导师,因为老师没..

2021-01-17 19:40:39 114

原创 毛概简答题自测

第一章 毛泽东思想及其历史地位1️⃣ 毛泽东思想活的灵魂是什么?第二章 新民主主义革命理论1️⃣ 新民主主义革命总路线的基本内容是什么?对象:动力:领导力量:性质:前途:第三章 社会主义改造理论1️⃣ 为什么说新民主主义社会是一个过渡性社会?经济原因:政治原因:社会原因:2️⃣ 我国对资本主义工商业进行社会主义改造的方式、途径和结果。3️⃣ ⭐️确立社会主义基本制度的重大意义。制度意义:经济意义:政治意义:世界意义:理论意义:第

2021-01-03 13:22:03 979 1

原创 数据结构期末上机范围

图邻接表BFS#include <iostream>using namespace std;class Queue { //循环队列private: int size; //队列的最大长度 int front; //队列头的指标 int rear; //队列尾的指标 int* listarray; //放置表元素的数组public: Queue() {} Queue(int sz); ~Queue(); void cl

2020-12-28 13:20:07 201

原创 pyecharts中折线图Line参数大全(内附优秀范例和官方文档)

关于折线的参数def add_yaxis( # 系列名称,用于 tooltip 的显示,legend 的图例筛选。 series_name: str, # 系列数据 y_axis: types.Sequence[types.Union[opts.LineItem, dict]], # 是否选中图例 is_selected: bool = True, # 是否连接空数据,空数据使用 `None` 填充 is_connect_nones:

2020-07-01 23:11:43 9375

原创 第15次作业

有一个整型数组,含10个元素,从键盘输入10个整数给数组,将此数组送到磁盘文件中存放。好像是课本上的一个例题,因为最后一周了,老师可能想给大家送点分。#include <fstream>#include <iostream>using namespace std;int main(){ int a[10]; for(int i=0; i<10; i++) cin >> a[i]; ofstream outfile(".\\file.txt",i

2020-06-19 20:38:52 159

原创 第14次作业

基础题目:用Windows编程,实现左键画矩形,右键画椭圆,刷新/最小化/改变窗口大小等动作,画面上的图形不会消失。#include <windows.h>#define MAX 10000class Shape{ private: int x1,y1; public: Shape(int x, int y): x1(x), y1(y) {} virtual void draw(HDC hdc,int x1,int y1,int x2,int y2)=0; int g

2020-06-19 20:35:08 170

原创 第13次作业

给出基类container:class container{ //声明抽象类containerprotected:double radius;public:container(double r); // container的构造函数virtual double surface_area(){}; //虚函数surface_areavirtual double volume(){}; //虚函数volume};要

2020-06-19 20:19:26 214

原创 2.25 图_BFS

2️⃣5️⃣ 图_BFS#include <iostream>#include <stack>#include <queue>using namespace std;#define MAX_VERTS 20class Vertex //顶点{public: Vertex(char lab): Label(lab) , wasVisited(0) {}public: bool wasVisited; char Label;};class Gr

2020-06-11 01:10:32 133

原创 2.24 图_DFS

2️⃣4️⃣ 图_DFS#include <iostream>#include <stack>using namespace std;#define MAX_VERTS 20class Vertex //顶点{public: Vertex(char lab): Label(lab) , wasVisited(0) {}public: bool wasVisited; char Label;};class Graph{public: Graph();

2020-06-11 01:07:41 116

原创 2.23 邻接表

2️⃣3️⃣ 邻接表???? 第一次接触类模板,迭代器,很新奇,希望以后能够慢慢理解,慢慢化为己用。#include <iostream>#include <list>using namespace std;class Vertex{public: char Label; Vertex(char lab):Label(lab) {}};ostream& operator << (ostream& out, const Vertex

2020-06-11 01:05:11 111

原创 2.22 邻接矩阵

2️⃣2️⃣ 邻接矩阵#include <iostream>using namespace std;#define MAX_VERTS 20class Vertex //顶点{public: Vertex(char lab): Label(lab) {}private: char Label;};class Graph{public: Graph(); ~Graph(); void addVertex(char lab); void addEdge(int

2020-06-10 22:59:08 114

原创 2.21 堆排序

2️⃣1️⃣ 堆排序???? 因为上节课学了堆,堆排序就是很简单的把数据放进堆,然后再取出来#include <iostream>#include <vector>using namespace std;class MaxHeap{private: int* heapArray; int maxSize; int currentSize; void trickleUp(int); //向上渗透 void trickleDown(int);//向下渗透pu

2020-06-10 22:06:22 89

原创 2.20 堆(完全二叉树)

2️⃣0️⃣ 堆(完全二叉树)???? 相比上一节的红黑树,这个代码好理解多了~#include <iostream>using namespace std;class MaxHeap{private: int* heapArray; int maxSize; int currentSize; void trickleUp(int); //向上渗透 void trickleDown(int);//向下渗透public: MaxHeap(int mx=10); ~M

2020-06-10 22:03:32 118

原创 2.19 红黑树

1️⃣9️⃣ 红黑树???? 不是个正确的代码,目前还没有能力把它改到正确,因为自己没能完全理解,以后学得更多了之后,再来改进吧。#include <iostream>using namespace std;class RedBlackTree;class RedBlackNode;class RedBlackNode{ friend class RedBlackTree;public: int data; RedBlackNode* left; RedBlackNod

2020-06-10 21:56:05 76

原创 2.18 二叉查找树

1️⃣8️⃣ 二叉查找树???? 有空把Delete和中序、前序、后序遍历加进来。#include <iostream>using namespace std;class BST;class BstNode{ friend class BST;private: int data; BstNode* LeftChild; BstNode* RightChild; void display(int i);public: int getdata(){return data;

2020-06-10 21:54:14 73

原创 第12次作业

某公司为其产品的消费者办理会员,具体要创建两个类:会员类(member)有会员号码、姓名、出生日期、电话号码、身份证号码(ID)、积分(point)等属性;会员分为普通会员和VIP会员;会员消费后均可获得积分;积分可兑换礼品;当普通会员积分达到一定数量,如3000,升级为VIP会员;当VIP会员兑换礼品后积分低于3000,降为普通会员;普通会员必须接收广告而VIP会员不用;VIP会员享受生日送祝福短信;主函数:main(){//创建1个普通会员m1;//m1获得积分;//m1积分超过3000,

2020-06-05 17:15:58 192

原创 2.17 基数排序

1️⃣7️⃣ 基数排序❔ radixsort函数可以理解,但是要自己敲出来有点困难,还要多多复习~#include <iostream>#include <vector>#include <list>using namespace std;int maxdigit(vector<int> &a){ int d = 1; int p = 10; for(int i=0; i<a.size(); i++){ while(a[i

2020-06-03 22:43:16 87

原创 2.16 链式队列

1️⃣6️⃣ 链式队列#include <iostream>using namespace std;class ListQueue{private: struct Node{ int data; Node* next; Node(int d, Node* n = 0):data(d), next(n) {} }; Node* Listfront; Node* Listback;public: ListQueue(); ~ListQueue(); bool I

2020-06-03 13:42:53 91

原创 2.15 链式栈

1️⃣5️⃣ 链式栈#include <iostream>using namespace std;class ListStack{private: struct Node{ int data; Node* next; Node(int d, Node* n = 0):data(d), next(n) {} }; Node* top;public: ListStack():top(0){} ~ListStack(){MakeEmpty();} bool IsEm

2020-06-03 13:42:15 87

原创 2.14 双向链表

1️⃣4️⃣ 双向链表#include <iostream>using namespace std;class DoubleList{private: struct DoubleNode{ DoubleNode* previous; int data; DoubleNode* next; DoubleNode(){} DoubleNode(int d){ data = d; previous = next = 0; } }; DoubleNod

2020-06-03 12:04:20 112

原创 2.13 循环链表

1️⃣3️⃣ 循环链表❓ 不知道为什么循环链表不能用析构函数,写了就出错。#include <iostream>using namespace std;class List{private: struct Node{ int data; Node* next; Node(){} Node(int d){ data = d; next = 0; } }; Node* head;public: List(); void Insert(const

2020-06-03 12:01:10 119

原创 2.12 链表

1️⃣2️⃣ 链表???? 反转感觉很难,要多加练习#include <iostream>using namespace std;class List{private: struct Node{ int data; Node* next; Node(int d){ data = d; next = 0; } }; Node* head;public: List(); ~List(); void Insert(const int i); vo

2020-06-03 12:00:37 95

原创 2.11 顺序队列

1️⃣1️⃣ 顺序队列#include <iostream>using namespace std;class Queue{private: int* queue; int front; int rear; int capacity;public: Queue(int quequeCapacity=10); bool IsEmpty()const; int Front()const; int Rear()const; void Push(const int i);

2020-06-02 12:41:08 129

原创 2.10 顺序栈

1️⃣0️⃣ 顺序栈#include <iostream>using namespace std;class mystack{private: int* Stack; int top; int capacity;public: mystack(int stackcapacity=10); ~mystack(); bool IsEmpty() const; int Top() const; void Push(const int i); void Pop();};

2020-06-02 12:40:21 122

原创 2.9 归并排序

9️⃣ 归并排序#include <iostream>#include <vector>using namespace std;void Merge(vector<int> &a, int left, int mid, int right){ if(left<mid&&mid<right){ Merge(a,left,(left+mid)/2,mid); Merge(a,mid,(mid+right)/2,right

2020-06-02 01:10:00 136

原创 2.8 快速排序

8️⃣ 快速排序#include <iostream>#include <vector>using namespace std;void Quick(vector<int> &a, int left, int right){ int key = a[left]; int i = left, j = right; while(i<j){ while(i<j&&a[j]>=key) j--; while(i&l

2020-06-02 01:07:59 97

原创 2.7 插入排序

7️⃣ 插入排序#include <iostream>#include <vector>using namespace std;void InsertSort(vector<int> &a){ int in, out, temp; for (out=1; out!=a.size(); out++){ in = out; temp = a[out]; while(a[in-1]>temp&&in>0){ a

2020-06-02 01:07:44 114

原创 2.6 Permutation

6️⃣ Permutation#include <iostream>#include <cstring>using namespace std;void Permutations(char* pa, int left, int right){ if(left==right) cout<<pa<<endl; else{ for(int i=left; i<right; i++){ swap(pa[left],pa[i]);

2020-06-02 01:04:38 165

原创 2.5 折半查找

5️⃣ 折半查找⭕️非递归#include <iostream>#include <vector>using namespace std;int Binary (const vector<int> &a, int left, int right, int x){ while (left<=right){ int center = (left + right) / 2; if (x==a[center]) return center;

2020-06-02 01:04:22 125

原创 2.4 顺序查找

4️⃣ 顺序查找#include <iostream>#include <vector>using namespace std;int SequentialSearch (const vector<int> &a, int x){ for (int i=0; i!= a.size(); i++) if(a[i]==x) return i; return -1;}int main(){ vector<int> a{3,6

2020-06-02 01:02:21 84

原创 2.3 SelectSort

3️⃣ SelectSort#include <iostream>#include <vector>using namespace std;void SelectSort(vector<int> &a){ int i, j, min; for (i=0; i!= a.size()-1; i++){ min = i; for (j=i; j!= a.size(); j++) if(a[j]< a[min]) min = j;

2020-06-02 01:02:04 114

原创 2.2 BubbleSort

2️⃣ BubbleSort#include <iostream>#include <vector>using namespace std;void BubbleSort(vector<int> &a){ int i, j; for (i=0; i!= a.size()-1; i++) for (j=0; j!= a.size()-i-1; j++) if(a[j]> a[j+1]) swap(a[j], a[j+1]);}

2020-06-02 00:59:41 154

原创 2.1 swap

1️⃣ swap#include <iostream>using namespace std;void swap (int &a, int &b){ int temp = a; a = b; b = temp;}int main(){ int x = 1, y = 2; swap(x, y); cout << x << y <<endl; return 0;}

2020-06-02 00:59:09 75

原创 4

4️⃣P8、9、10 给定N个整数的序列,求最大子列和【暴力法】【分治法】【⭐️动态规划】????‍⚖写在前面的总结:第一次接触分治法,理解尚可,代码难写,主要是自己现在对于递归不太熟练,理解的不够透彻;动态规划是第一次知道这个名词,但是这道题的动态规划方法理解起来并不困难,代码也挺简单的。同时也是第一次真正接触vector,真正地在代码里去使用它,竟然连简单的怎么初始化都不会,看来还要多学习。⭕️暴力法#include <iostream>#include <vector&

2020-05-30 22:27:04 71

空空如也

空空如也

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

TA关注的人

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