python学习过程的那些坑
python学习过程中遇到的问题
有情怀的机械男
这个作者很懒,什么都没留下…
展开
-
【python 学习】——pycharm终端解释器和Python解释器配置
【python 学习】——pycharm终端解释器和Python解释器配置原创 2022-06-05 00:20:14 · 3966 阅读 · 3 评论 -
【pyqt5学习】【python学习】——通过py文件来执行命令行指令
【pyqt5学习】【python学习】——通过py文件来执行命令行指令原创 2022-04-28 10:54:43 · 1757 阅读 · 0 评论 -
【纠错】——QThread: Destroyed while thread is still running
【纠错】——QThread: Destroyed while thread is still running原创 2022-04-26 11:35:23 · 1185 阅读 · 0 评论 -
【纠错】——mysql Authentication plugin ‘caching_sha2_password‘ is not supported问题处理
mysql Authentication plugin ‘caching_sha2_password’ is not supported问题处理使用mysql8.0版本,登录失败,提示 Authentication plugin ‘caching_sha2_password’ is not supported。原因是在MySQL 8.0以后,默认的密码加密方式是caching_sha2_password而不是mysql_native_password。解决方法:1.登录mysql数据库 mys原创 2022-01-05 14:22:28 · 2415 阅读 · 0 评论 -
【ValueError: Target is multiclass but average=‘binary‘. Please choose another average setting, one 】
完整报错为:ValueError: Target is multiclass but average='binary'. Please choose another average setting, one of [None, 'micro', 'macro', 'weighted'].解决方法对于多分类任务,将from sklearn.metrics import f1_scoref1_score(y_test, y_pred)改为:f1_score(y_test, y_pre原创 2022-01-01 10:47:16 · 6396 阅读 · 0 评论 -
【Not all parameters were used in the SQL statement】
在添加游标的时候,添加prepared=Truecursor = mydb.cursor(prepared=True)感谢博主:【已解决】Python MySQL: Not all parameters were used in the SQL statement - MoonYear530 - 博客园一、事故缘起 今天构造了一个超过 50 多个参数的 SQL 插入语句,在执行的时候提示 Not all parameters were used in the SQL statement,提示「S原创 2021-12-30 21:20:53 · 697 阅读 · 0 评论 -
纠错——【Singleton array array(0.2) cannot be considered a valid collection.】
# 将数据集按照比例划分为训练集和测试集def split_datas(datas,labels,random_state=1,train_size=0.9,test_size=0.1): train_data, test_data, train_label, test_label = sklearn.model_selection.train_test_split(datas, .原创 2021-12-29 19:14:37 · 13754 阅读 · 1 评论 -
pyinstaller打包执行exe出现“ModuleNotFoundError: No module named ‘scipy.spatial.transform._rotation_group”
这个是因为打包后的第三方库中缺少了pyd文件具体的解决方法:去环境下找到相应的py文件,根据https://blog.csdn.net/qq_41007606/article/details/109565069文章写的方法,将py编译成pyd文件,然后将pyd文件复制到dist相应的第三库目录下即可·...原创 2021-01-16 16:24:44 · 1792 阅读 · 0 评论 -
UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figur
“UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure”在利用mask_rcnn进行物体检测的时候出现的问题,主要是因为matplotlib的使用格式不对可以检查者两个地方:1、visualize.py中import matplotlib.pyplot as plt改为:import matplotlibmatplotlib.u.原创 2021-01-11 22:58:02 · 1139 阅读 · 0 评论 -
【pyqt5】配置Qt Designer之【designer.exe的保存位置及ui文件转py文件及no Qt platform plugin could be initialized 问题解决】
配置Qt Designer到PyCharm:https://blog.csdn.net/qq_40386321/article/details/96451616新版的designer.exe保存位置在:X:\Users\13711\AppData\Local\Programs\Python\Python37\Lib\site-packages\qt5_applications\Qt\bin\designer.exe原创 2020-11-21 17:27:56 · 1875 阅读 · 0 评论 -
MATLAB调用Python自定义函数(类、函数等)& Python调用MATLAB
参考链接:https://blog.csdn.net/qq_27280237/article/details/84644900知乎链接:https://zhuanlan.zhihu.com/p/92081119知乎上这位说的更加的详细,感谢原创 2020-11-17 18:21:52 · 2405 阅读 · 0 评论 -
使用numpy出现DeprecationWarning: The normed argument is ignored when density is provided. 解决方法&忽略警告的方法
目录1、从根本上进行解决2、直接利用warning模块忽略警告1、从根本上进行解决“DeprecationWarning: The normed argument is ignored when density is provided. In future passing both will result in an error.”这种一般是因为函数库或者是一些包package版本更新而产生的一些警告提示信息LBPHist,_ = np.histogram(lbp, norm.原创 2020-10-12 10:07:26 · 1979 阅读 · 0 评论 -
[PyCharm]unindent does not match any outer indentation level解决方法
转载:https://www.jianshu.com/p/b34f30717eb2问题出现原因1、代码前后缩进量不一致2、tab和space混用(如果一段代码既使用space又使用tab进行缩进,会发生错误,这个时候PyCharm会自动进行判断,根据设置的预先缩进值(intentaion)进行调整)解决方法1、对于问题1可以直接更改缩进量2、缩进量看起来一致但是还是报错的话,可以先确认下是不是真的混用了,方法如下:PyCharm->view->Active Edito原创 2020-09-24 10:15:48 · 2608 阅读 · 0 评论 -
Python中利用plt显示中文标题解决方案
解决方法plt.rcParams['font.sans-serif']=['SimHei']plt.rcParams['axes.unicode_minus'] = Falseplt.title('灰度级别频率图')plt.show()原创 2020-09-03 21:16:39 · 8610 阅读 · 0 评论 -
“RuntimeWarning: overflow encountered in ubyte_scalars像素加减运算溢出异常”原因以及解决办法
转载本文请注明详细地址 本文介绍了像素点相加减溢出的原因与解决方法目录原因:解决方法:原因:这个问题一般是会出现在图像处理像素的加减中,出现的原因是因为图片的像素一般是八位即最大值是256,最小值是0,如果超出了这个范围就会出现警告,不会报错使得程序停止下来,但是会使得计算出来的结果有误。#假设一个图片像素点的灰度值为136,另一个像素点的灰度值为180,两个灰度值相加出现的结果按道理来说是:316但是得出来的结果是:60,出现这种情况的原因就是因为316溢出了0-256的范围,原创 2020-08-26 11:32:41 · 10200 阅读 · 0 评论 -
python常用的第三方库总结
通用 urllib -网络库(stdlib)。 requests -网络库。 grab – 网络库(基于pycurl)。 pycurl – 网络库(绑定libcurl)。 urllib3 – Python HTTP库,安全连接池、支持文件post、可用性高。 httplib2 – 网络库。 RoboBrowser – 一个简单的、极具Python风格的Python库,...转载 2020-03-26 13:56:44 · 5077 阅读 · 0 评论 -
python中yield的用法详解——最简单,最清晰的解释(转载)
首先,如果你还没有对yield有个初步分认识,那么你先把yield看做“return”,这个是直观的,它首先是个return,普通的return是什么意思,就是在程序中返回某个值,返回之后程序就不再往下运行了。看做return之后再把它看做一个是生成器(generator)的一部分(带yield的函数才是真正的迭代器),好了,如果你对这些不明白的话,那先把yield看做return,然后直接看下面...转载 2020-03-26 13:54:40 · 131 阅读 · 0 评论 -
python第三方库安装的各种方法(全网最全,最简单易懂)
使用镜像:pip install virtualenv -i https://pypi.douban.com/simple国内源: pip install -i https://pypi.tuna.tsinghua.edu.cn/simple module_name或 pip install -i https://pypi.douban.com/simple mo...原创 2020-03-26 13:33:30 · 583 阅读 · 0 评论