![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
错误
十三先生po
哈哈哈哈哈哈哈哈哈哈嗝儿
展开
-
Access针对该架构进行的规范, XML验证失败。以下 XML文档行中存在错误:
使用 access 导入表时,报错:针对该架构进行的规范 XML验证失败。以下 XML 文档中存在错误:|。问题背景access以新表方式导入excel表时,在最后一步导入报错Access针对该架构进行的规范, XML验证失败。以下 XML文档行中存在错误:问题解决原因是表名中包含除了 “.xlsx” 之外的点,去掉即可解决方法: 去掉表名中多余的点即可(如下图)...原创 2022-04-11 16:48:54 · 5327 阅读 · 0 评论 -
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.
问题背景在使用机器学习线性回归的时候,用数据进行线性回归报错Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.问题解决原因是使用的数据维度有缺失x_tr.shape #(12,)使用np.array和reshape方法重设数组维度即可# 转换数组模式x_tr1 = np.array(x_tr).reshape(-1,1)x_ts1 = np.ar原创 2022-03-22 14:31:49 · 6188 阅读 · 0 评论 -
Could not find a version that satisfies the requirement skimage
问题背景参考网址:安装skimage出错的解决方法问题解决的途径pip安装python包出错:Could not find a version that satisfies the requirement skimage (from versions: )…安装python的skimage库时出错,报错为: ERROR: Command errored out with exit status 1: command: 'c:\users\lenovo\appdata\local\原创 2022-03-11 15:07:38 · 3579 阅读 · 2 评论 -
TypeError: concatenate() got multiple values for argument ‘axis‘
问题背景使用朴素贝叶斯后,想把列值进行合并,使用numpy.concatenate方法时报错:TypeError: concatenate() got multiple values for argument ‘axis‘问题解决原因是有一列是没有列维度值的,需要使用方法添加一下,目标列的基本情况为使用reshape方法进行重置y2_test_predict.reshape(5,1)最后用合并成功!# y2_test_predict没有列维度,需要reshape重置一下test_d原创 2022-03-06 15:48:23 · 7667 阅读 · 1 评论 -
ValueError: X has 2 features, but LogisticRegression is expecting 5 features as input.
问题背景用python的sklearn库做逻辑回归模型训练后,用一些数值去预测结果时报错,已知是多项式的逻辑回归模型用的是二阶的边界函数画出来的抛物线代码如下pay1和pay2是用来预测y结果的,函数中的关键θ(用于计算x2)也提取出来了#边界函数参数获取theta0 = LR2.intercept_theta1,theta2,theta3,theta4,theta5 = LR2.coef_[0][0],LR2.coef_[0][1],LR2.coef_[0][2],LR2.coef原创 2022-01-24 14:49:09 · 17674 阅读 · 0 评论 -
ValueError: Found input variables with inconsistent numbers of samples
解决ValueError: Found input variables with inconsistent numbers of samples问题背景使用python的sklearn库进行线性回归时,对x,y的素材进行训练时报错:ValueError: Found input variables with inconsistent numbers of samples部分代码如下:# 自变量(天数)x = np.arange(1,len(detail_tstep_group3[detail_原创 2022-01-13 17:57:17 · 13335 阅读 · 0 评论 -
IndexError: single positional indexer is out-of-bounds
问题背景使用pandas模块对数据进行计算,需要计算出如下每日的日均变化量报错IndexError: single positional indexer is out-of-bounds问题解决指索引下标越界了,所以找到报错的地方检查下标是否在数据列表范围内说白一些就是列表的最后一行数据不能向下计算了,需要忽略想办法把他忽略掉,可以再遍历的时候将数值减一...原创 2022-01-04 16:27:45 · 39577 阅读 · 0 评论 -
ValueError: Location based indexing can only have [integer, integer slice (START point is INCLUDED,
Python学习系列之padas-DataFrame问题背景在使用pandas模块的iloc方法时出错ValueError: Location based indexing can only have [integer, integer slice (START point is INCLUDED,问题解决使用iloc方法的时候,两个关键变量都要是下标位置而不是列的名称iloc[下标位置,下标位置]...原创 2022-01-04 16:22:50 · 6959 阅读 · 1 评论 -
ModuleNotFoundError: No module named ‘scipy‘
问题背景在使用pandas做数据分析时,想看看特征区分度import pandas as pdimport numpy as npimport openpyxlimport matplotlib.pyplot as pltimport copyplt.style.use('seaborn') # 改变图像风格plt.rcParams['font.family'] = ['Arial Unicode MS', 'Microsoft Yahei', 'SimHei', 'sans-serif原创 2021-12-31 14:49:41 · 1713 阅读 · 0 评论 -
ValueError: Can only compare identically-labeled Series objects
问题参考[译] Pandas中根据列的值选取多行数据pandas匹配特定值索引选取多行数据关于python:错误:只能比较标记相同的DataFrame对象pandas 两个多值序列匹配问题背景使用python的pandas模块进行两个数据框之间的特定行值的匹配,使用如下代码时报错data_guang_fail2[data_guang_fail2.二维码名称 == data_guang_mean.二维码名称]ValueError: Can only compare identically-l原创 2021-12-30 09:25:23 · 3656 阅读 · 0 评论 -
ValueError: invalid literal for int() with base 10: ‘1.4‘
问题背景在练习python经典面试题时,使用int方法报错int('1.4')ValueError: invalid literal for int() with base 10: '1.4'问题解决int方法不能对字符串产生作用int(1.4)成功输出原创 2021-11-18 11:35:17 · 457 阅读 · 0 评论 -
TypeError: Animal() takes no arguments
问题背景在联系python经典面试题的时候,做到了解引用计数机制时,创建类报错附上联系网址python面试常见问题# 91、简述python引用计数机制# python垃圾回收主要以引用计数为主,标记-清除和分代清除为辅的机制,其中标记-清除和分代回收主要是为了处理循环引用的难题。# 引用计数算法# 当有1个变量保存了对象的引用时,此对象的引用计数就会加1# 当使用del删除变量指向的对象时,如果对象的引用计数不为1,比如3,那么此时只会让这个引用计数减1,即变为2,当再次调用del时,变为1原创 2021-11-18 11:29:10 · 1365 阅读 · 0 评论 -
TypeError: ‘list‘ object is not callable
参考知识点python set转为list_python 怎么把set转成listPython3_TypeError: ‘list’ object is not callableTypeError: ‘list’ object is not callable 问题解决Python错误: ‘list’ object is not callable问题背景将s = “ajldjlajfdljfddd”,去重并从小到大排序输出"adfjl"s = "ajldjlajfdljfddd"set去重,原创 2021-11-16 15:33:09 · 3350 阅读 · 1 评论 -
TypeError: expected string or bytes-like object
问题背景使用python的jieba库进行词云分析的时候,报错,附上本人学习实操的练习记录网址python使用jieba模块进行文本分析和搜索引擎推广“旅行青蛙”数据分析实战TypeError: expected string or bytes-like object目标代码wordcloud = WordCloud(font_path=r'data\font\arial unicode ms.ttf').generate(txt2)wordcloud# 显示plt.figure(fig原创 2021-10-31 17:50:35 · 980 阅读 · 0 评论 -
IndexError: list index out of range
问题参考python 异常处理 try except问题背景使用python的beautifulsoup库爬取网页数据的时候,使用select方法找标签并赋值时报错IndexError: list index out of range关键部位原代码date = i.select('.c-abstract')dict['date'].append(''.join(date[0].get_text().split()))问题解决重点怀疑是没有找到对应标签,在选择输出第一个元素的时候报错,原创 2021-10-26 19:57:25 · 2902 阅读 · 0 评论 -
AttributeError: ‘NoneType‘ object has no attribute ‘append‘
问题参考将元素追加到Python中的空列表字典中Python之字典添加元素的几种方法问题背景使用python的beautifulsoup库爬取网页数据的时候,将得到的值放进dict字典中存储,报错AttributeError: 'NoneType' object has no attribute 'append'关键部位的原代码dict = {'page':page,'title':None,'source':None,'date':None,'url':None}source = i原创 2021-10-26 19:50:05 · 674 阅读 · 0 评论 -
报错AttributeError: ResultSet object has no attribute ‘get_text‘.
问题参考问题背景使用python的beautifulsoup库爬取网页数据的时候,使用select方法找标签并赋值,get_text()提取文本内容时,报错:AttributeError: ResultSet object has no attribute 'get_text'. You're probably treating a list of elements like a single element. Did you call find_all() when you meant to cal原创 2021-10-26 19:43:18 · 5253 阅读 · 0 评论 -
python使用beautifulsoup中select方法爬虫时使用join和split方法配合处理特殊字符
问题参考python如何去掉字符串‘\xa0’Python split()方法Python join()方法python中join()函数的使用方法问题背景使用python对百度网页进行爬取时,爬取的摘要标签中,时间和文章内容在同一标签下,但属于同一标签,抓取的数据本身如果有空格,在编译的时候会输出字符\xa0 ,使用join和split的组合方法去掉想要爬取目标数据:使用beautifulsoup的select方法爬取出来的效果如下:想要的输出的结果:问题解决使用join和sp原创 2021-10-26 12:02:50 · 602 阅读 · 0 评论 -
报错:[Errno 22] Invalid argument: ‘data\text.txt‘
问题解决参考python在使用绝对路径时出现OSError: [Errno 22] Invalid argument: ‘E:\python\python扩展\text_file\pi_digits.txt问题背景使用with open语句时报错[Errno 22] Invalid argument: 'data\text.txt'原代码with open('data\text.txt','r',encoding='GBk') as f: a = f.read()解决问题原因可原创 2021-10-22 15:20:49 · 855 阅读 · 0 评论 -
python使用pandas时替换列数据报错TypeError: unsupported operand type(s) for +: ‘int‘ and ‘str
目录问题背景处理问题方法1:直接删除方法2:使用列数据类型转换方法问题背景在使用pandas时查询一份csv文件并进行缺失值处理,附上pandas学习网址python使用pandas模块介绍以及使用,dataframe结构,Series结构,基本数据操作,DataFrame运算,pandas画图,存储https://blog.csdn.net/weixin_55579895/article/details/120709917处理缺失值时发现nan值以外的“?”标记数值,先将他变成nan值,然后使原创 2021-10-13 17:44:43 · 3861 阅读 · 0 评论 -
python使用with open语句保存文件时的路径问题及报错FileNotFoundError: [Errno 2] No such file or directory
需要注意自己当前编程的环境,如果目录没有写完整,则会报错:FileNotFoundError: [Errno 2] No such file or directory: '第二天/tiebatieba/2.0页.html'例子我需要将一份文件保存在第二天/tieba文件夹下,尽管我的编程文件在第二天下面,但是当前的环境路径为lv19 爬虫开发与实战/第二天,我需要将“第二天”这个路径也加上去file_path = '第二天/tieba/'+ self.tieba_name + str(self..原创 2021-09-17 17:44:29 · 11150 阅读 · 0 评论 -
[Errno 13] Permission denied: ‘test1.csv‘
问题背景使用pandas模块读取csv文件的时候报错[Errno 13] Permission denied: 'test1.csv'解决问题读取前先将打开检查的文件关闭否则报错,成功读取原创 2021-10-13 14:29:36 · 685 阅读 · 0 评论 -
python使用pandas模块设置行列索引后单元数值全变Nan值
问题背景使用pandas模块设置行列索引后单元数值全变Nan值代码如下# 错误# 构造行索引序列st_code = ['股票'+str(i) for i in range(st_change.shape[0])]print(st_code)# 添加行索引data = pd.DataFrame(st_change, index=st_code)data解决问题原因分析这种写法可能不适用正确写法:方法1:对dataframe结构的行索引index直接更改,有可能出问题,取决于赋什原创 2021-10-12 16:57:04 · 2497 阅读 · 0 评论 -
解决TypeError: set_ticks() takes 2 positional arguments but 3 were given
其他问题参考:Python基础-TypeError:takes 2 positional arguments but 3 were given https://blog.csdn.net/weixin_42716620/article/details/82888572报错通识某个方法传进去过多的参数导致报错问题背景:在使用python的matplotlib模块的多个坐标系显示-plt.subplots(面向对象的画图方法)时,报错如下TypeError: set_ticks() takes原创 2021-10-09 21:32:02 · 15058 阅读 · 2 评论 -
python爬虫使用selenium模块时报错TypeError: object of type ‘WebElement‘ has no len()
问题背景使用selenium模块登陆某个页面,在传参的时候报错TypeError: object of type ‘WebElement’ has no len()以下是可能出现问题的代码# 输入账号,没有调用账号包就手写user_name.send_keys(user_name)# 输入内容user_pwd = dr.find_element_by_id('p')# 输入密码,没有调用账号包就手写user_pwd.send_keys(user_pwd)问题解决该文件定义的实参名原创 2021-09-29 16:09:12 · 1281 阅读 · 0 评论 -
python爬虫使用selenium运行报错“‘WebElement‘ object is not subscriptable”
其他解决方法selenium运行报错“‘WebElement‘ object is not subscriptable”https://blog.csdn.net/weixin_46777073/article/details/107316005find_elements_by_xxx() 用法以及 报错TypeError: ‘FirefoxWebElement’ object is not subscriptablehttps://blog.csdn.net/sunandstarws/article原创 2021-09-28 16:17:48 · 5067 阅读 · 1 评论 -
解决python使用webdriver.Chrome()打开Google谷歌浏览器秒关,报错libpng warning: iCCP: cHRM chunk does not match sRGB
目录其他解决方法问题解决方法其他解决方法【OpenCVError】libpng warning: iCCP: cHRM chunk does not match sRGBchrome webdriver_selenium自动化测试时chrome浏览器为什么会自动关闭?https://blog.csdn.net/weixin_39613291/article/details/110602839Python 的 libpng warning: iCCP: cHRM chunk does not matc原创 2021-09-28 15:35:16 · 1071 阅读 · 0 评论 -
python安装能在Google谷歌浏览器使用的用于爬虫的chromedriver
目录下载chromedriver的网址选择版本找到python的安装位置检查是否安装成功如果还没有安装python,可以参考这位博主的安装方法一条龙服务,还有一些安装失败的情况解决方法Python+Selenium+chromedriver安装及环境配置https://blog.csdn.net/hl0322/article/details/113624241下载chromedriver的网址https://npm.taobao.org/mirrors/chromedriver选择版本打开谷歌原创 2021-09-28 14:55:21 · 290 阅读 · 0 评论 -
解决python中TypeError: not enough arguments for format string错误
在爬虫保存初步数据是,使用print方法查看输出的结果解决python中TypeError: not enough arguments for format string(https://blog.csdn.net/w926498/article/details/80579520)print(['{%s:%s},%s'] % book_name,book_url,book_appraise))# 报错# TypeError: not enough arguments for format stri原创 2021-09-24 15:03:04 · 644 阅读 · 0 评论