成功解决ValueError: setting an array element with a sequence.

简介: 成功解决ValueError: setting an array element with a sequence.

解决问题


ValueError: setting an array element with a sequence.




解决方法


值错误:用序列设置数组元素。


输出值查看,发现为,即输出嵌套列表内第一个列表即可!


plt.plot(x,test_predict)

改为

plt.plot(x,test_predict[0])


哈哈,大功告成!


相关文章
|
3月前
|
Java
java lab8--------7-2 sdut-JAVA-Insert Integer element into array lists
java lab8--------7-2 sdut-JAVA-Insert Integer element into array lists
21 0
|
Python
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
452 0
LeetCode 215. Kth Largest Element in an Array
在未排序的数组中找到第 k 个最大的元素。请注意,你需要找的是数组排序后的第 k 个最大的元素,而不是第 k 个不同的元素。
79 0
|
人工智能 C++ Python
LeetCode 961. N-Repeated Element in Size 2N Array
LeetCode 961. N-Repeated Element in Size 2N Array
188 0
成功解决ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
成功解决ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
|
Python
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
913 0
成功解决ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
成功解决ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or
|
算法 Java
LeetCode 229 Majority Element II(主要元素II)(Array)(Boyer–Moore majority vote algorithm)
版权声明:转载请联系本人,感谢配合!本站地址:http://blog.csdn.net/nomasp https://blog.csdn.net/NoMasp/article/details/52356817 原文 给定一个长度为n的整型数组,找出所有出现超过 ⌊ n/3 ⌋ 次的元素。
1027 0
|
5月前
|
Python
使用array()函数创建数组
使用array()函数创建数组。
86 3