Traceback (most recent call last): File "E:\two2\python\pycharm\py\lianxi\14\14-1.py", line 7, in <module> plt.boxplot(data.values, sym='o', whis=1.5) File "E:\two2\python\py\Lib\site-packages\matplotlib\pyplot.py", line 2483, in boxplot return gca().boxplot( ^^^^^^^^^^^^^^ File "E:\two2\python\py\Lib\site-packages\matplotlib\__init__.py", line 1459, in inner return func(ax, *map(sanitize_sequence, args), **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\two2\python\py\Lib\site-packages\matplotlib\axes\_axes.py", line 3914, in boxplot bxpstats = cbook.boxplot_stats(x, whis=whis, bootstrap=bootstrap, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\two2\python\py\Lib\site-packages\matplotlib\cbook\__init__.py", line 1232, in boxplot_stats stats['mean'] = np.mean(x) ^^^^^^^^^^ File "<__array_function__ internals>", line 200, in mean File "E:\two2\python\py\Lib\site-packages\numpy\core\fromnumeric.py", line 3464, in mean return _methods._mean(a, axis=axis, dtype=dtype, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\two2\python\py\Lib\site-packages\numpy\core\_methods.py", line 181, in _mean ret = umr_sum(arr, axis, dtype, out, keepdims, where=where) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: unsupported operand type(s) for +: 'Timestamp' and 'Timestamp'
时间: 2023-08-23 20:07:38 浏览: 128
Mac下anaconda中Spyder打开报错Traceback(most recent call last)…问题
5星 · 资源好评率100%
这是一个错误信息,看起来是在使用 matplotlib 库的 boxplot 函数时出现了数据类型不匹配的问题。错误提示中提到了 Timestamp 类型,这可能意味着数据中包含有时间戳类型的数据,而 boxplot 函数无法处理这种类型的数据。建议检查数据类型和数据格式是否正确,并进行必要的类型转换。
阅读全文