12 2020 档案

摘要:原文链接:http://www.juzicode.com/archives/3273 错误提示: 利用pandas绘制多个子图时报错:AttributeError: ‘list’ object has no attribute ‘get_figure’ #... 阅读全文
posted @ 2020-12-30 19:46 桔子code 阅读(934) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/3139 错误提示: pyplot.hist()绘制直方图时提示:ValueError: x must have 2 or fewer dimensions #juzicode.c... 阅读全文
posted @ 2020-12-30 19:44 桔子code 阅读(341) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/3112 pandas为我们提供了容易上手使用的数据结构和数据分析工具,它的Series和DataFrame数据类型都有一个plot()方法,可以用于绘制常用图形。 1、线型图、基... 阅读全文
posted @ 2020-12-30 18:40 桔子code 阅读(468) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/3127 错误提示: 在pandas中用to_excel()写文件提示:ModuleNotFoundError: No module named ‘xlwt’: import nu... 阅读全文
posted @ 2020-12-28 20:07 桔子code 阅读(1572) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/3125 错误提示: 用pandas read_excel()方法读取xls或xlsx文件时,提示:ImportError: Missing optional dependency... 阅读全文
posted @ 2020-12-28 19:47 桔子code 阅读(2090) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2530 matplotlib除了可以绘制曲线图, 还可以绘制统计图形,这篇文章介绍饼图、柱状图等几种常用统计图形的绘制方法。 1、饼图 使用pie()方法绘制饼图: pr... 阅读全文
posted @ 2020-12-28 08:22 桔子code 阅读(315) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2532 在matploblib中,绘图操作通常可以用pyplot.plot()实现,但是如果需要在一个画布上绘制多张图片,则需要用到subplots()或subplot()方法。 1... 阅读全文
posted @ 2020-12-25 08:27 桔子code 阅读(608) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2455 在做数据处理时用图形显示出处理结果,可以得到更直观的判断。Python中matplotlib为我们提供了非常强大的绘图功能,它可以绘制曲线图、柱图、饼图、散点图、三维图等... 阅读全文
posted @ 2020-12-24 21:00 桔子code 阅读(449) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2840 错误提示: 定义函数时,使用三引号注释提示错误:IndentationError: expected an indented block #juzicode.com/vx:桔... 阅读全文
posted @ 2020-12-21 21:04 桔子code 阅读(376) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2756 错误提示: 开启线程时提示TypeError: func() argument after * must be an iterable, not int #juzicod... 阅读全文
posted @ 2020-12-20 12:27 桔子code 阅读(1201) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2749 错误提示: 使用with方法打开文件后,再次read()文件时提示:ValueError: I/O operation on closed file. #juzicode.c... 阅读全文
posted @ 2020-12-20 12:26 桔子code 阅读(860) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2745 错误提示: 读写文件时提示UnsupportedOperation: not readable #juzicode.com/vx:桔子codefileobj=open('ex... 阅读全文
posted @ 2020-12-20 12:25 桔子code 阅读(495) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2736 错误提示: 字符串到10进制转换时提示:ValueError: invalid literal for int() with base 10: ‘1a’ #juzico... 阅读全文
posted @ 2020-12-20 12:25 桔子code 阅读(823) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2731 错误提示: 使用%s格式化tuple类型的字符串时提示: TypeError: not all arguments converted during string forma... 阅读全文
posted @ 2020-12-20 12:25 桔子code 阅读(127) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2725 错误提示: 格式化字符串时提示index超出范围:IndexError: Replacement index 5 out of range for positional ar... 阅读全文
posted @ 2020-12-20 12:24 桔子code 阅读(1106) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2720 错误提示: #juzicode.com/vx:桔子codes1={1,2,3,4}#集合s1s2={3,4,5,6}#集合s2print('s1-s2:',s1-s2)pri... 阅读全文
posted @ 2020-12-19 11:46 桔子code 阅读(665) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2715 错误提示: 构建set类型的数据时,使用tuple类型的数据作为元素没有问题,使用list、dict类型的数据作为元素报TypeError: unhashable type:... 阅读全文
posted @ 2020-12-19 11:42 桔子code 阅读(236) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2711 错误提示: list使用数字类型的下标访问没有问题,字典使用数字类型的下标访问时提示KeyError: 0 #juzicode.com/vx:桔子codel = ['juzi... 阅读全文
posted @ 2020-12-19 11:32 桔子code 阅读(1262) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2692 错误提示: 调用列表的元素时提示:IndexError: list assignment index out of range #juzicode.com/vx:桔子cod... 阅读全文
posted @ 2020-12-19 11:27 桔子code 阅读(546) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2706 错误提示: 用tuple类型的数据作为字典的key不报错,用list类型的数据作为字典的key时,提示TypeError: unhashable type: ‘list’ ... 阅读全文
posted @ 2020-12-19 11:27 桔子code 阅读(297) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2701 错误提示: 使用list的index方法查找元素时提示:ValueError: 20 is not in list #juzicode.com/vx:桔子codelst = ... 阅读全文
posted @ 2020-12-19 11:27 桔子code 阅读(1068) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2669 错误提示:进行除法运算时,提示ZeroDivisionError: division by zero #juzicode.com/vx:桔子codelst = [5,4,3,... 阅读全文
posted @ 2020-12-19 11:27 桔子code 阅读(1007) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2498 错误提示: 使用matplotlib画子图时提示:ValueError: Single argument to subplot must be a three-digit i... 阅读全文
posted @ 2020-12-18 19:47 桔子code 阅读(1038) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2672 错误提示: 使用print()函数打印字符串,提示print后面的括号是无效字符:SyntaxError: invalid character in identifier #... 阅读全文
posted @ 2020-12-18 19:45 桔子code 阅读(956) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2575 要画桔子,先对着个桔子看几分钟: 看完了桔子该动手了,先画个外形: print('\n-----欢迎来到juzicode.com')print('-----公众号: 桔子c... 阅读全文
posted @ 2020-12-16 07:58 桔子code 阅读(183) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2493 错误提示: 打开文件路径提示参数无效:OSError: [Errno 22] Invalid argument: ‘D:\juzicode\桔子code\readme.txt... 阅读全文
posted @ 2020-12-12 08:23 桔子code 阅读(371) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2486 错误提示: 使用matplotlib legend提示:ValueError: Unrecognized location ‘upper’. Valid location... 阅读全文
posted @ 2020-12-09 20:08 桔子code 阅读(197) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2411 错误提示: 进行加减法运算时提示:TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’: D:\ju... 阅读全文
posted @ 2020-12-08 22:37 桔子code 阅读(4027) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2421 在matplotlib中默认是不能正常显示中文: import numpy as npimport matplotlib.pyplot as pltimport matp... 阅读全文
posted @ 2020-12-08 22:37 桔子code 阅读(413) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/1466 前两天桔子菌在调试代码的时候发现自己写的一个方法怎么也执行不到,这个自定义的类大概是下面这样子的: class ClassA(object): def __init__... 阅读全文
posted @ 2020-12-07 12:51 桔子code 阅读(37) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2364 错误提示: 使用变量时提示NameError: name ‘a’ is not defined D:\juzicode>python test-not-define.py微信... 阅读全文
posted @ 2020-12-06 20:29 桔子code 阅读(791) 评论(0) 推荐(0)
摘要:原文链接:http://www.juzicode.com/archives/2344 某些命令在windows cmd命令行下提示“请求的操作需要提升”: 发生这种错误一般是因为启动cmd是以普通用户打开的,需要用管理员身份启动命令行,可以新建”启动命令... 阅读全文
posted @ 2020-12-01 21:35 桔子code 阅读(342) 评论(0) 推荐(0)
摘要:在《编码: 一个隐藏了30多年的bug,Windows含蓄说过某通不行?》一文中我们简单讨论了Unicode和UTF-8的关系,UTF-8本身并不是一种字符集,而是实现Unicode字符集的一种编码方式。RFC3629规定的Unicode字符集和UTF-8编码... 阅读全文
posted @ 2020-12-01 12:37 桔子code 阅读(84) 评论(0) 推荐(0)