ValueError: setting an array element with a sequence.
来源:互联网 发布:百度大数据合作 编辑:程序博客网 时间:2024/05/29 18:56
http://blog.csdn.net/pipisorry/article/details/48031035
From the code you showed us, the only thing we can tell is that you trying to create an array from a list that isn't shaped like a multi-dimensional array. For example
numpy.array([[1,2], [2, 3, 4]])
or
numpy.array([[1,2], [2, [3, 4]]])
will yield this error message, because the shape of the input list isn't a (generalised) "box" that can be turned into a multidimensional array. So probably UnFilteredDuringExSummaryOfMeansArraycontains sequences of different lengths.
Edit: Another possible cause for this error message is trying to use a string as an element in an array of type float:
numpy.array([1.2, "abc"], dtype=float)
That is what you are trying according to your edit. If you really want to have a NumPy array containing both strings and floats, you could use the dtype object, which enables the array to hold arbitrary Python objects:
numpy.array([1.2, "abc"], dtype=object)
Without knowing what your code shall accomplish, I can't judge if this is what you want.
皮皮Blog
ps:array 未对齐,先查看array是否对齐,可能是数据集末尾行存在多余行
http://stackoverflow.com/questions/4674473/valueerror-setting-an-array-element-with-a-sequence
http://blog.csdn.net/pipisorry/article/details/23563441
from:http://blog.csdn.net/pipisorry/article/details/48031035ref:
- ValueError: setting an array element with a sequence.
- ValueError: setting an array element with a sequence.
- ValueError: setting an array element with a sequence.
- tf 报错提示ValueError: setting an array element with a sequence.
- fast rcnn 遇到valueError setting an array element with a sequence错误
- setting an array element with a sequence
- tensorflow报错:setting an array element with a sequence
- Leetcode: Searching an Element in a Rotated Sorted Array I
- CareerCup Find if an array is a sequence
- Algorithm: Reverse a Integer to an array with recursion
- __curl_rule_01__ declared as an array with a negative size
- '__curl_rule_01__'declared as an array with a negative size
- post a json object with an array using curl
- How can I combine elements of an array that have a common element?
- Finding Second Minimum element in an Array
- Remove an element from Javascript Array
- Kth Largest Element in an Array
- Leetcode Kth Largest Element in an Array
- 【2015/8/27】当我们在说平台的时候,我们究竟在说什么。
- Building a Space Station(POJ--2031【最小生成树】
- org.apache.axis2.AxisFault: No such operation 'plus'
- jquery easyui combobox加载数量过多引起渲染页面缓慢问题
- Quartz定时调度CronTrigger时间配置格式说明与实例
- ValueError: setting an array element with a sequence.
- Stockbroker Grapevine(floyd+暴力枚举)
- 排序算法之快速排序
- 文本标签过滤
- android 记录一下自己的微信支付
- Java并发编程:线程池的使用
- JSP文件保存的编码与页面中的pageEncoding和contentType之间的关系
- mysql琐碎知识点
- 正则表达式之掌握grep的用法