自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 protobuf python的基本使用

testbed.proto文件,并通过protoc.exe --python_out=.\ testbed.proto对其进行编译syntax = "proto2";message Addmsgbody { repeated Msgbody body = 1;}//定义消息头部message Msgbody{ required string NodeId = 1; required string MsgId = 2; required string SendTime = 3

2021-09-02 15:50:26 283

原创 python连接postgresql数据库

import psycopg2#连接数据库conn = psycopg2.connect(database=“postgres”, user=“postgres”,password=“postgres”, host=“202.202.66.169”, port=“32786”)#创建游标cursor = conn.cursor()#执行mysql语句cursor.execute(“select * from diagnosis_traindata”)#提交命令conn.commit()

2021-04-22 10:49:19 101

原创 Python连接mysql数据库

Python连接mysql数据库安装三个包:pip install pandaspip install sqlalchemypip install pymysql数据库连接:import pandas as pdfrom sqlalchemy import create_engine#初始化数据库连接#按实际情况依次填写MySQL的用户名、密码、IP地址、端口、数据库名engine = create_engine(‘mysql+pymysql://root:12345678@local

2021-04-22 10:44:55 87

原创 python 换源 快速安装包

python 换源pip install 包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

2021-04-21 15:41:40 118

原创 获取数据库中的数据

获取数据库中的数据 Params = SVMParams.objects.all() #获取数据库的数据 C_dict = {sd.id: sd.C for sd in Params} #生成键与值 gamma_dict = {sd.id: sd.gamma for sd in Params} C_list = list(C_dict.values()) #列表化取值 gamma_list = list(gamma_dict.values(...

2021-04-21 09:54:39 345

原创 python 后端数据保存在数据库

python 后端数据保存在数据库form 字典,且里面的value的类型应该与model里面的设置一样 通过序列化完成 form = {'best_estimator': char} best_estimator = SVMParamsSerializer(data=form) if best_estimator.is_valid(raise_exception=True): best_estimator.save()...

2021-04-20 20:56:43 166

原创 机器学习-Python中训练模型的保存和再使用

机器学习-Python中训练模型的保存和再使用模型保存BP:model.save(save_dir)SVM:from sklearn.externals import joblibjoblib.dump(clf, save_dir)模型调用:BP:from keras.models import load_modelmodel = load_model(open_dir)SVM:from sklearn.externals import joblibmodel = joblib.load

2021-04-20 20:50:24 479

原创 git 管理项目常用指令

git 管理项目常用指令在项目目录中git branch查看当前所处分支git checkout -b rights创建新分支(-b代表新建分支,checkout代表切换分支)git branch查看当前所处分支git status查看状态接下来把本地新建的rights分支推送到码云origin仓库中,同时以rights分支进行保存git push -u origin rightsgit add . 将代码存放在暂存区git status检查状态 (所有文件变为绿色代表添加到了暂存区)gi

2021-03-08 10:27:01 101

空空如也

空空如也

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

TA关注的人

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