随笔分类 - Python
摘要:一、关于虚拟环境 通过cmd或者Anaconda Prompt,两个命令都可以 1、查看虚拟环境列表: conda env list conda info --envs 2、删除环境: conda remove -n xxxxx(名字) --all 解释:remove表示删除,-n是(name名字的
阅读全文
摘要:import torch from torchvision import models import csv from sklearn.metrics import classification_report import cv2 as cv import os device = torch.dev
阅读全文
摘要:import cv2 as cv from sklearn.model_selection import train_test_split import torch from torch.utils.data import DataLoader, TensorDataset from torchvi
阅读全文
摘要:
1、Bs4解析 #安装bs 4 import requests from bs4 import BeautifulSoup # 1 url="" resp=requests.get(url) # 2.将请求到的数据变成 BeautifulSoup 对象 sp=BeautifulSoup(resp.t
阅读全文

摘要:from sympy import * #定义符号变量 a,b,c,a1,a2,a3,b1,b2,R,x = symbols("a,b,c,a1,a2,a3,b1,b2,R,x") #公式 a = ((-(4*R**2*(cos(b1))**2*(sin(b1)*(pow((x**2)*sin(a3
阅读全文
摘要:
一、需求 相关研究表明,银行等企业的数字化转型相关特征信息更容易体现在具有总结和指导性质的年度报表中(吴非,2021)。因此,通过统计银行年报中涉及“数字化转型”的词频来刻画其转型程度,具有可行性和科学性。具体而言,本文借助Python 爬虫功能对中国40家上市银行年度报表进行爬取,并采用Jieba
阅读全文

摘要:
第一步 排除文件打开方式错误: r只读,r+读写,不创建 w新建只写,w+新建读写,二者都会将文件内容清零 (以w方式打开,不能读出。w+可读写) w+与r+区别: r+:可读可写,若文件不存在,报错;w+: 可读可写,若文件不存在,创建 r+与a+区别: fd = open("1.txt",'w+
阅读全文

摘要:
最终版:07_中证网(Plus -Pro).py # coding=utf-8 import requests from bs4 import BeautifulSoup import io import sys import os sys.stdout = io.TextIOWrapper(sys
阅读全文

摘要:
前言 在我们写代码的过程中,我们开发的脚本一般都会用到一些第三方包,可能别人也需要用到我们的脚本,如果我们将我们的xx.py文件发给他,他是不能直接用的,他还需要安装python解释器,甚至还要安装我们用的那些第三方包,是不是有点小麻烦?但是我们都知道,PC是可以直接运行exe文件的,这就为我们
阅读全文
