Array

* [] 常用方法
*  pop push  shift unshift  reverse sort  splice(n,m,x,y,z...) //改变原有数组  数组的变异
*  slice  concat  toString  join  indexOf
*
*  迭代的方法
*  forEach  map  filter(过滤)
*  some   只要有一项满足条件, 那么some的返回结果就是true; 找到true之后,后边的内容就不再循环
*  every  只要有一项不满足条件, 那么every的返回结果就是false; 找到false之后,后边的内容就不再循环
*  reduce((prev,next,index,ary)=>{},xxx); 接收1-2个参数;若第二个参数不传;则prev默认是数组的第一项;再循环时,prev就是上一次的循环的返回值;
*  reduce的返回值 是最后一次迭代的返回值;
*
*
*
*  find   返回值是符合条件的第一项;若是没有符合条件的;则返回 undefined
*
*  includes(数组中的某一项,index)  返回值是个 boolean
*
* */
处理股票 SZsz300755 失败: input array type is not double 处理股票 SZsz300756 失败: input array type is not double 处理股票 SZsz300757 失败: input array type is not double 处理股票 SZsz300758 失败: input array type is not double 处理股票 SZsz300759 失败: input array type is not double 处理股票 SZsz300760 失败: input array type is not double 处理股票 SZsz300761 失败: input array type is not double 处理股票 SZsz300762 失败: input array type is not double 处理股票 SZsz300763 失败: input array type is not double 处理股票 SZsz300765 失败: input array type is not double 处理股票 SZsz300766 失败: input array type is not double 处理股票 SZsz300767 失败: input array type is not double 处理股票 SZsz300768 失败: input array type is not double 处理股票 SZsz300769 失败: input array type is not double 处理股票 SZsz300770 失败: input array type is not double 处理股票 SZsz300771 失败: input array type is not double 处理股票 SZsz300772 失败: input array type is not double 处理股票 SZsz300773 失败: input array type is not double 处理股票 SZsz300775 失败: input array type is not double 处理股票 SZsz300776 失败: input array type is not double 处理股票 SZsz300777 失败: input array type is not double 处理股票 SZsz300778 失败: input array type is not double 处理股票 SZsz300779 失败: input array type is not double 处理股票 SZsz300780 失败: input array type is not double 处理股票 SZsz300781 失败: input array type is not double 处理股票 SZsz300782 失败: input array type is not double 处理股票 SZsz300783 失败: input array type is not double 处理股票 SZsz300785 失败: input array type is not double 处理股票 SZsz300786 失败: input array type is not double 处理股票 SZsz300787 失败: input array type is not double 处理股票 SZsz300788 失败: input array type is not double 处理股票 SZsz300789 失败: input array type is not double 处理股票 SZsz300790 失败: input array type is not double 处理股票数据: 95%|█████████▍| 6371/6720 [00:15<00:00, 437.00it/s]处理股票 SZsz300791 失败: input array type is not double 处理股票 SZsz300792 失败: input array type is not double 处理股票 SZsz300793 失败: input array type is not double 处理股票 SZsz300795 失败: input array type is not double 处理股票 SZsz300796 失败: input array type is not double 处理股票 SZsz300797 失败: input array type is not double 处理股票 SZsz300798 失败: input array type is not double 处理股票 SZsz300799 失败: input array type is not double 处理股票 SZsz300800 失败: input array type is not double 处理股票 SZsz300801 失败: input array type is not double 处理股票 SZsz300802 失败: input array type is not double 处理股票 SZsz300803 失败: input array type is not double 处理股票 SZsz300805 失败: input array type is not double 处理股票 SZsz300806 失败: input array type is not double 处理股票 SZsz300807 失败: input array type is not double 处理股票 SZsz300808 失败: input array type is not double 处理股票 SZsz300809 失败: input array type is not double 处理股票 SZsz300810 失败: input array type is not double 处理股票 SZsz300811 失败: input array type is not double 处理股票 SZsz300812 失败: input array type is not double 处理股票 SZsz300813 失败: input array type is not double 处理股票 SZsz300815 失败: input array type is not double 处理股票 SZsz300816 失败: input array type is not double 处理股票 SZsz300817 失败: input array type is not double 处理股票 SZsz300818 失败: input array type is not double 处理股票 SZsz300819 失败: input array type is not double 处理股票 SZsz300820 失败: input array type is not double 处理股票 SZsz300821 失败: input array type is not double 处理股票 SZsz300822 失败: input array type is not double 处理股票 SZsz300823 失败: input array type is not double 处理股票 SZsz300824 失败: input array type is not double 处理股票 SZsz300825 失败: input array type is not double 处理股票 SZsz300826 失败: input array type is not double 处理股票 SZsz300827 失败: input array type is not double 处理股票 SZsz300828 失败: input array type is not double 处理股票 SZsz300829 失败: input array type is not double 处理股票 SZsz300830 失败: input array type is not double 处理股票 SZsz300831 失败: input array type is not double 处理股票 SZsz300832 失败: input array type is not double 处理股票 SZsz300833 失败: input array type is not double 处理股票 SZsz300835 失败: input array type is not double 处理股票 SZsz300836 失败: input array type is not double 处理股票 SZsz300837 失败: input array type is not double 处理股票 SZsz300838 失败: input array type is not double 处理股票 SZsz300839 失败: input array type is not double 处理股票 SZsz300840 失败: input array type is not double 处理股票 SZsz300841 失败: input array type is not double 处理股票 SZsz300842 失败: input array type is not double 处理股票 SZsz300843 失败: input array type is not double 处理股票 SZsz300845 失败: input array type is not double 处理股票 SZsz300846 失败: input array type is not double 处理股票 SZsz300847 失败: input array type is not double 处理股票 SZsz300848 失败: input array type is not double 处理股票 SZsz300849 失败: input array type is not double 处理股票 SZsz300850 失败: input array type is not double 处理股票 SZsz300851 失败: input array type is not double 处理股票 SZsz300852 失败: input array type is not double 处理股票 SZsz300853 失败: input array type is not double 处理股票 SZsz300855 失败: input array type is not double 处理股票 SZsz300856 失败: input array type is not double 处理股票 SZsz300857 失败: input array type is not double 处理股票 SZsz300858 失败: input array type is not double 处理股票 SZsz302132 失败: input array type is not double 处理股票 SZsz399001 失败: input array type is not double 处理股票 SZsz399002 失败: input array type is not double 处理股票 SZsz399003 失败: input array type is not double 处理股票 SZsz399004 失败: input array type is not double 处理股票 SZsz399005 失败: input array type is not double 处理股票 SZsz399006 失败: input array type is not double 处理股票 SZsz399007 失败: input array type is not double 处理股票 SZsz399008 失败: input array type is not double 处理股票 SZsz399009 失败: input array type is not double 处理股票 SZsz399010 失败: input array type is not double 处理股票 SZsz399011 失败: input array type is not double 处理股票 SZsz399012 失败: input array type is not double 处理股票 SZsz399013 失败: input array type is not double 处理股票 SZsz399015 失败: input array type is not double 处理股票 SZsz399016 失败: input array type is not double 处理股票 SZsz399017 失败: input array type is not double 处理股票 SZsz399018 失败: input array type is not double 处理股票 SZsz399019 失败: input array type is not double 处理股票 SZsz399020 失败: input array type is not double 处理股票 SZsz399050 失败: input array type is not double 处理股票 SZsz399088 失败: input array type is not double 处理股票 SZsz399100 失败: input array type is not double 处理股票 SZsz399101 失败: input array type is not double 处理股票 SZsz399102 失败: input array type is not double 处理股票 SZsz399103 失败: input array type is not double 处理股票 SZsz399106 失败: input array type is not double 处理股票 SZsz399107 失败: input array type is not double 处理股票数据: 96%|█████████▌| 6459/6720 [00:15<00:00, 431.42it/s]处理股票 SZsz399108 失败: input array type is not double 处理股票 SZsz399231 失败: input array type is not double 处理股票 SZsz399232 失败: input array type is not double 处理股票 SZsz399233 失败: input array type is not double 处理股票 SZsz399234 失败: input array type is not double 处理股票 SZsz399235 失败: input array type is not double 处理股票 SZsz399236 失败: input array type is not double 处理股票 SZsz399237 失败: input array type is not double 处理股票 SZsz399238 失败: input array type is not double 处理股票 SZsz399239 失败: input array type is not double 处理股票 SZsz399240 失败: input array type is not double 处理股票 SZsz399241 失败: input array type is not double 处理股票 SZsz399242 失败: input array type is not double 处理股票 SZsz399243 失败: input array type is not double 处理股票 SZsz399244 失败: input array type is not double 处理股票 SZsz399248 失败: input array type is not double 处理股票 SZsz399249 失败: input array type is not double 处理股票 SZsz399262 失败: input array type is not double 处理股票 SZsz399263 失败: input array type is not double 处理股票 SZsz399264 失败: input array type is not double 处理股票 SZsz399265 失败: input array type is not double 处理股票 SZsz399266 失败: input array type is not double 处理股票 SZsz399275 失败: input array type is not double 处理股票 SZsz399276 失败: input array type is not double 处理股票 SZsz399277 失败: input array type is not double 处理股票 SZsz399278 失败: input array type is not double 处理股票 SZsz399279 失败: input array type is not double 处理股票 SZsz399280 失败: input array type is not double 处理股票 SZsz399281 失败: input array type is not double 处理股票 SZsz399282 失败: input array type is not double 处理股票 SZsz399283 失败: input array type is not double 处理股票 SZsz399284 失败: input array type is not double 处理股票 SZsz399285 失败: input array type is not double 处理股票 SZsz399286 失败: input array type is not double 处理股票 SZsz399290 失败: input array type is not double 处理股票 SZsz399291 失败: input array type is not double 处理股票 SZsz399292 失败: input array type is not double 处理股票 SZsz399293 失败: input array type is not double 处理股票 SZsz399294 失败: input array type is not double 处理股票 SZsz399295 失败: input array type is not double 处理股票 SZsz399296 失败: input array type is not double 处理股票 SZsz399297 失败: input array type is not double 处理股票 SZsz399298 失败: input array type is not double 处理股票 SZsz399299 失败: input array type is not double 处理股票 SZsz399300 失败: input array type is not double 处理股票 SZsz399301 失败: input array type is not double 处理股票 SZsz399302 失败: input array type is not double 处理股票 SZsz399303 失败: input array type is not double 处理股票 SZsz399306 失败: input array type is not double 处理股票 SZsz399307 失败: input array type is not double 处理股票 SZsz399310 失败: input array type is not double 处理股票 SZsz399311 失败: input array type is not double 处理股票 SZsz399312 失败: input array type is not double 处理股票 SZsz399313 失败: input array type is not double 处理股票 SZsz399314 失败: input array type is not double 处理股票 SZsz399315 失败: input array type is not double 处理股票 SZsz399316 失败: input array type is not double 处理股票 SZsz399317 失败: input array type is not double 处理股票 SZsz399318 失败: input array type is not double 处理股票 SZsz399319 失败: input array type is not double 处理股票 SZsz399320 失败: input array type is not double 处理股票 SZsz399321 失败: input array type is not double 处理股票 SZsz399322 失败: input array type is not double 处理股票 SZsz399324 失败: input array type is not double 处理股票 SZsz399326 失败: input array type is not double 处理股票 SZsz399328 失败: input array type is not double 处理股票 SZsz399330 失败: input array type is not double 处理股票 SZsz399333 失败: input array type is not double 处理股票 SZsz399335 失败: input array type is not double 处理股票 SZsz399337 失败: input array type is not double 处理股票 SZsz399339 失败: input array type is not double 处理股票 SZsz399341 失败: input array type is not double 处理股票 SZsz399344 失败: input array type is not double 处理股票 SZsz399346 失败: input array type is not double 处理股票 SZsz399348 失败: input array type is not double 处理股票 SZsz399350 失败: input array type is not double 处理股票 SZsz399351 失败: input array type is not double 处理股票 SZsz399352 失败: input array type is not double 处理股票 SZsz399353 失败: input array type is not double 处理股票 SZsz399354 失败: input array type is not double 处理股票 SZsz399355 失败: input array type is not double 处理股票 SZsz399356 失败: input array type is not double 处理股票 SZsz399357 失败: input array type is not double 处理股票 SZsz399358 失败: input array type is not double 处理股票 SZsz399359 失败: input array type is not double 处理股票 SZsz399360 失败: input array type is not double 处理股票 SZsz399361 失败: input array type is not double 处理股票 SZsz399362 失败: input array type is not double 处理股票数据: 97%|█████████▋| 6547/6720 [00:15<00:00, 430.39it/s]处理股票 SZsz399363 失败: input array type is not double 处理股票 SZsz399364 失败: input array type is not double 处理股票 SZsz399365 失败: input array type is not double 处理股票 SZsz399366 失败: input array type is not double 处理股票 SZsz399367 失败: input array type is not double 处理股票 SZsz399368 失败: input array type is not double 处理股票 SZsz399369 失败: input array type is not double 处理股票 SZsz399370 失败: input array type is not double 处理股票 SZsz399371 失败: input array type is not double 处理股票 SZsz399372 失败: input array type is not double 处理股票 SZsz399373 失败: input array type is not double 处理股票 SZsz399374 失败: input array type is not double 处理股票 SZsz399375 失败: input array type is not double 处理股票 SZsz399376 失败: input array type is not double 处理股票 SZsz399377 失败: input array type is not double 处理股票 SZsz399378 失败: input array type is not double 处理股票 SZsz399379 失败: input array type is not double 处理股票 SZsz399380 失败: input array type is not double 处理股票 SZsz399381 失败: input array type is not double 处理股票 SZsz399382 失败: input array type is not double 处理股票 SZsz399383 失败: input array type is not double 处理股票 SZsz399384 失败: input array type is not double 处理股票 SZsz399385 失败: input array type is not double 处理股票 SZsz399386 失败: input array type is not double 处理股票 SZsz399387 失败: input array type is not double 处理股票 SZsz399388 失败: input array type is not double 处理股票 SZsz399389 失败: input array type is not double 处理股票 SZsz399390 失败: input array type is not double 处理股票 SZsz399391 失败: input array type is not double 处理股票 SZsz399392 失败: input array type is not double 处理股票 SZsz399393 失败: input array type is not double 处理股票 SZsz399394 失败: input array type is not double 处理股票 SZsz399395 失败: input array type is not double 处理股票 SZsz399396 失败: input array type is not double 处理股票 SZsz399397 失败: input array type is not double 处理股票 SZsz399398 失败: input array type is not double 处理股票 SZsz399399 失败: input array type is not double 处理股票 SZsz399400 失败: input array type is not double 处理股票 SZsz399401 失败: input array type is not double 处理股票 SZsz399402 失败: input array type is not double 处理股票 SZsz399403 失败: input array type is not double 处理股票 SZsz399404 失败: input array type is not double 处理股票 SZsz399405 失败: input array type is not double 处理股票 SZsz399406 失败: input array type is not double 处理股票 SZsz399407 失败: input array type is not double 处理股票 SZsz399408 失败: input array type is not double 处理股票 SZsz399409 失败: input array type is not double 处理股票 SZsz399410 失败: input array type is not double 处理股票 SZsz399411 失败: input array type is not double 处理股票 SZsz399412 失败: input array type is not double 处理股票 SZsz399413 失败: input array type is not double 处理股票 SZsz399415 失败: input array type is not double 处理股票 SZsz399416 失败: input array type is not double 处理股票 SZsz399417 失败: input array type is not double 处理股票 SZsz399418 失败: input array type is not double 处理股票 SZsz399419 失败: input array type is not double 处理股票 SZsz399420 失败: input array type is not double 处理股票 SZsz399422 失败: input array type is not double 处理股票 SZsz399423 失败: input array type is not double 处理股票 SZsz399427 失败: input array type is not double 处理股票 SZsz399428 失败: input array type is not double 处理股票 SZsz399429 失败: input array type is not double 处理股票 SZsz399431 失败: input array type is not double 处理股票 SZsz399432 失败: input array type is not double 处理股票 SZsz399433 失败: input array type is not double 处理股票 SZsz399434 失败: input array type is not double 处理股票 SZsz399435 失败: input array type is not double 处理股票 SZsz399436 失败: input array type is not double 处理股票 SZsz399437 失败: input array type is not double 处理股票 SZsz399438 失败: input array type is not double 处理股票 SZsz399439 失败: input array type is not double 处理股票 SZsz399440 失败: input array type is not double 处理股票 SZsz399441 失败: input array type is not double 处理股票 SZsz399481 失败: input array type is not double 处理股票 SZsz399550 失败: input array type is not double 处理股票 SZsz399551 失败: input array type is not double 处理股票 SZsz399552 失败: input array type is not double 处理股票 SZsz399553 失败: input array type is not double 处理股票 SZsz399554 失败: input array type is not double 处理股票 SZsz399555 失败: input array type is not double 处理股票 SZsz399556 失败: input array type is not double 处理股票 SZsz399557 失败: input array type is not double 处理股票 SZsz399602 失败: input array type is not double 处理股票 SZsz399604 失败: input array type is not double 处理股票 SZsz399606 失败: input array type is not double 处理股票 SZsz399608 失败: input array type is not double 处理股票 SZsz399610 失败: input array type is not double 处理股票 SZsz399611 失败: input array type is not double 处理股票数据: 99%|█████████▊| 6635/6720 [00:15<00:00, 431.38it/s]处理股票 SZsz399612 失败: input array type is not double 处理股票 SZsz399613 失败: input array type is not double 处理股票 SZsz399614 失败: input array type is not double 处理股票 SZsz399615 失败: input array type is not double 处理股票 SZsz399616 失败: input array type is not double 处理股票 SZsz399617 失败: input array type is not double 处理股票 SZsz399618 失败: input array type is not double 处理股票 SZsz399619 失败: input array type is not double 处理股票 SZsz399620 失败: input array type is not double 处理股票 SZsz399621 失败: input array type is not double 处理股票 SZsz399622 失败: input array type is not double 处理股票 SZsz399623 失败: input array type is not double 处理股票 SZsz399624 失败: input array type is not double 处理股票 SZsz399625 失败: input array type is not double 处理股票 SZsz399626 失败: input array type is not double 处理股票 SZsz399627 失败: input array type is not double 处理股票 SZsz399628 失败: input array type is not double 处理股票 SZsz399629 失败: input array type is not double 处理股票 SZsz399630 失败: input array type is not double 处理股票 SZsz399631 失败: input array type is not double 处理股票 SZsz399632 失败: input array type is not double 处理股票 SZsz399633 失败: input array type is not double 处理股票 SZsz399634 失败: input array type is not double 处理股票 SZsz399635 失败: input array type is not double 处理股票 SZsz399636 失败: input array type is not double 处理股票 SZsz399637 失败: input array type is not double 处理股票 SZsz399638 失败: input array type is not double 处理股票 SZsz399639 失败: input array type is not double 处理股票 SZsz399640 失败: input array type is not double 处理股票 SZsz399641 失败: input array type is not double 处理股票 SZsz399642 失败: input array type is not double 处理股票 SZsz399643 失败: input array type is not double 处理股票 SZsz399644 失败: input array type is not double 处理股票 SZsz399645 失败: input array type is not double 处理股票 SZsz399646 失败: input array type is not double 处理股票 SZsz399647 失败: input array type is not double 处理股票 SZsz399648 失败: input array type is not double 处理股票 SZsz399649 失败: input array type is not double 处理股票 SZsz399650 失败: input array type is not double 处理股票 SZsz399651 失败: input array type is not double 处理股票 SZsz399652 失败: input array type is not double 处理股票 SZsz399653 失败: input array type is not double 处理股票 SZsz399654 失败: input array type is not double 处理股票 SZsz399655 失败: input array type is not double 处理股票 SZsz399656 失败: input array type is not double 处理股票 SZsz399657 失败: input array type is not double 处理股票 SZsz399658 失败: input array type is not double 处理股票 SZsz399659 失败: input array type is not double 处理股票 SZsz399660 失败: input array type is not double 处理股票 SZsz399661 失败: input array type is not double 处理股票 SZsz399662 失败: input array type is not double 处理股票 SZsz399663 失败: input array type is not double 处理股票 SZsz399664 失败: input array type is not double 处理股票 SZsz399665 失败: input array type is not double 处理股票 SZsz399666 失败: input array type is not double 处理股票 SZsz399667 失败: input array type is not double 处理股票 SZsz399668 失败: input array type is not double 处理股票 SZsz399669 失败: input array type is not double 处理股票 SZsz399670 失败: input array type is not double 处理股票 SZsz399671 失败: input array type is not double 处理股票 SZsz399672 失败: input array type is not double 处理股票 SZsz399673 失败: input array type is not double 处理股票 SZsz399674 失败: input array type is not double 处理股票 SZsz399675 失败: input array type is not double 处理股票 SZsz399676 失败: input array type is not double 处理股票 SZsz399677 失败: input array type is not double 处理股票 SZsz399678 失败: input array type is not double 处理股票 SZsz399679 失败: input array type is not double 处理股票 SZsz399680 失败: input array type is not double 处理股票 SZsz399681 失败: input array type is not double 处理股票 SZsz399682 失败: input array type is not double 处理股票 SZsz399683 失败: input array type is not double 处理股票 SZsz399684 失败: input array type is not double 处理股票 SZsz399685 失败: input array type is not double 处理股票 SZsz399686 失败: input array type is not double 处理股票 SZsz399687 失败: input array type is not double 处理股票 SZsz399688 失败: input array type is not double 处理股票 SZsz399689 失败: input array type is not double 处理股票 SZsz399690 失败: input array type is not double 处理股票 SZsz399691 失败: input array type is not double 处理股票 SZsz399692 失败: input array type is not double 处理股票 SZsz399693 失败: input array type is not double 处理股票 SZsz399694 失败: input array type is not double 处理股票 SZsz399695 失败: input array type is not double 处理股票 SZsz399696 失败: input array type is not double 处理股票 SZsz399697 失败: input array type is not double 处理股票 SZsz399698 失败: input array type is not double 处理股票 SZsz399699 失败: input array type is not double 处理股票数据: 100%|██████████| 6720/6720 [00:15<00:00, 424.22it/s] 处理股票 SZsz399701 失败: input array type is not double 处理股票 SZsz399702 失败: input array type is not double 处理股票 SZsz399703 失败: input array type is not double 处理股票 SZsz399704 失败: input array type is not double 处理股票 SZsz399705 失败: input array type is not double 处理股票 SZsz399706 失败: input array type is not double 处理股票 SZsz399707 失败: input array type is not double 处理股票 SZsz399750 失败: input array type is not double 处理股票 SZsz399802 失败: input array type is not double 处理股票 SZsz399803 失败: input array type is not double 处理股票 SZsz399804 失败: input array type is not double 处理股票 SZsz399805 失败: input array type is not double 处理股票 SZsz399806 失败: input array type is not double 处理股票 SZsz399807 失败: input array type is not double 处理股票 SZsz399808 失败: input array type is not double 处理股票 SZsz399809 失败: input array type is not double 处理股票 SZsz399810 失败: input array type is not double 处理股票 SZsz399811 失败: input array type is not double 处理股票 SZsz399812 失败: input array type is not double 处理股票 SZsz399813 失败: input array type is not double 处理股票 SZsz399814 失败: input array type is not double 处理股票 SZsz399817 失败: input array type is not double 处理股票 SZsz399850 失败: input array type is not double 处理股票 SZsz399852 失败: input array type is not double 处理股票 SZsz399901 失败: input array type is not double 处理股票 SZsz399903 失败: input array type is not double 处理股票 SZsz399904 失败: input array type is not double 处理股票 SZsz399905 失败: input array type is not double 处理股票 SZsz399908 失败: input array type is not double 处理股票 SZsz399909 失败: input array type is not double 处理股票 SZsz399910 失败: input array type is not double 处理股票 SZsz399911 失败: input array type is not double 处理股票 SZsz399912 失败: input array type is not double 处理股票 SZsz399913 失败: input array type is not double 处理股票 SZsz399914 失败: input array type is not double 处理股票 SZsz399917 失败: input array type is not double 处理股票 SZsz399918 失败: input array type is not double 处理股票 SZsz399919 失败: input array type is not double 处理股票 SZsz399922 失败: input array type is not double 处理股票 SZsz399925 失败: input array type is not double 处理股票 SZsz399928 失败: input array type is not double 处理股票 SZsz399931 失败: input array type is not double 处理股票 SZsz399932 失败: input array type is not double 处理股票 SZsz399933 失败: input array type is not double 处理股票 SZsz399934 失败: input array type is not double 处理股票 SZsz399935 失败: input array type is not double 处理股票 SZsz399939 失败: input array type is not double 处理股票 SZsz399944 失败: input array type is not double 处理股票 SZsz399950 失败: input array type is not double 处理股票 SZsz399951 失败: input array type is not double 处理股票 SZsz399952 失败: input array type is not double 处理股票 SZsz399957 失败: input array type is not double 处理股票 SZsz399958 失败: input array type is not double 处理股票 SZsz399959 失败: input array type is not double 处理股票 SZsz399961 失败: input array type is not double 处理股票 SZsz399963 失败: input array type is not double 处理股票 SZsz399964 失败: input array type is not double 处理股票 SZsz399965 失败: input array type is not double 处理股票 SZsz399966 失败: input array type is not double 处理股票 SZsz399967 失败: input array type is not double 处理股票 SZsz399969 失败: input array type is not double 处理股票 SZsz399970 失败: input array type is not double 处理股票 SZsz399971 失败: input array type is not double 处理股票 SZsz399972 失败: input array type is not double 处理股票 SZsz399973 失败: input array type is not double 处理股票 SZsz399974 失败: input array type is not double 处理股票 SZsz399975 失败: input array type is not double 处理股票 SZsz399976 失败: input array type is not double 处理股票 SZsz399977 失败: input array type is not double 处理股票 SZsz399978 失败: input array type is not double 处理股票 SZsz399979 失败: input array type is not double 处理股票 SZsz399982 失败: input array type is not double 处理股票 SZsz399983 失败: input array type is not double 处理股票 SZsz399986 失败: input array type is not double 处理股票 SZsz399987 失败: input array type is not double 处理股票 SZsz399989 失败: input array type is not double 处理股票 SZsz399990 失败: input array type is not double 处理股票 SZsz399991 失败: input array type is not double 处理股票 SZsz399992 失败: input array type is not double 处理股票 SZsz399993 失败: input array type is not double 处理股票 SZsz399994 失败: input array type is not double 处理股票 SZsz399995 失败: input array type is not double 处理股票 SZsz399996 失败: input array type is not double 处理股票 SZsz399997 失败: input array type is not double 处理股票 SZsz399998 失败: input array type is not double Traceback (most recent call last): File D:\Anaconda\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals) File d:\股票量化数据库\股票量化数据库\untitled3.py:449 main() File d:\股票量化数据库\股票量化数据库\untitled3.py:426 in main X_train, y_train = trainer.prepare_dataset(train_data, cluster_model, feature_engineer) File d:\股票量化数据库\股票量化数据库\untitled3.py:341 in prepare_dataset X_full = pd.concat(X_list, axis=0) File D:\Anaconda\Lib\site-packages\pandas\core\reshape\concat.py:380 in concat op = _Concatenator( File D:\Anaconda\Lib\site-packages\pandas\core\reshape\concat.py:443 in __init__ objs, keys = self._clean_keys_and_objs(objs, keys) File D:\Anaconda\Lib\site-packages\pandas\core\reshape\concat.py:505 in _clean_keys_and_objs raise ValueError("No objects to concatenate") ValueError: No objects to concatenate
最新发布
07-20
<think>根据错误信息,主要问题有两个: 1. 在计算技术指标(如RSI、MACD)时,出现了“input array type is not double”的错误。这是因为TA-Lib要求输入的数据类型是双精度浮点数(double),而我们之前为了节省内存将价格数据转换为了float32。 2. 在准备训练数据集时,由于前面的特征工程失败,导致没有成功处理任何股票数据,因此X_list为空,在合并时出现了“No objects to concatenate”的错误。 解决方案: 1. 在调用TA-Lib函数之前,将所需的列转换为双精度浮点数(float64)。计算完成后再转换回float32以节省内存。 2. 在特征工程类中,对于TA-Lib计算的部分,临时转换为float64,计算后再转换回float32。 3. 确保至少有一些股票数据被成功处理,避免合并空列表。 具体修改如下: 修改特征工程类中的transform方法: - 对于需要TA-Lib计算的列(如close),在计算前转换为float64,计算完成后再将结果转换为float32,并将原数据转换回float32。 - 注意:我们只对计算技术指标时需要的列进行临时转换,避免内存占用过大。 此外,为了确保程序健壮性,我们还需要: - 在特征工程中捕获异常,避免单只股票的失败影响整个程序。 - 确保即使有部分股票失败,只要还有成功处理的股票,程序就能继续运行。 下面我们修改代码:</think>根据错误日志,主要存在两个问题: 1. 特征计算时出现 "input array type is not double" 错误 2. 最终没有成功处理任何股票数据,导致数据合并失败 ### 解决方案 #### 问题1: "input array type is not double" 错误 这个错误是由于TA-Lib库要求输入数据为双精度浮点数(double),而我们之前为了节省内存使用了float32类型。解决方案是在特征工程中临时转换为double进行计算。 修改特征工程类: ```python class FeatureEngineer: def __init__(self, config): self.config = config def transform(self, df): """添加技术指标特征""" # 创建临时副本用于TA-Lib计算 df_temp = df.copy() # 将价格列转换为float64以满足TA-Lib要求 for col in ['open', 'high', 'low', 'close']: df_temp[col] = df_temp[col].astype(np.float64) # 价格变化 df['price_change'] = df['close'].pct_change().fillna(0) # 波动率 df['volatility'] = df['close'].rolling(5).std().fillna(0) # 成交量变化 df['volume_change'] = df['volume'].pct_change().fillna(0) # 移动平均线 df['MA5'] = df['close'].rolling(5).mean().fillna(0) df['MA20'] = df['close'].rolling(20).mean().fillna(0) # RSI - 使用临时副本 df['RSI14'] = ta.RSI(df_temp['close'].values, timeperiod=14) df['RSI14'] = df['RSI14'].fillna(50) # 默认值50 # MACD - 使用临时副本 macd, macd_signal, macd_hist = ta.MACD(df_temp['close'].values, fastperiod=12, slowperiod=26, signalperiod=9) df['MACD'] = np.nan_to_num(macd) df['MACD_signal'] = np.nan_to_num(macd_signal) df['MACD_hist'] = np.nan_to_num(macd_hist) # 布林带 - 使用临时副本 upper, middle, lower = ta.BBANDS(df_temp['close'].values, timeperiod=20, nbdevup=2, nbdevdn=2) df['BB_upper'] = np.nan_to_num(upper) df['BB_middle'] = np.nan_to_num(middle) df['BB_lower'] = np.nan_to_num(lower) # 处理无穷大和NaN df = df.replace([np.inf, -np.inf], np.nan) df = df.fillna(0) # 优化内存 return reduce_mem_usage(df) ``` #### 问题2: 没有成功处理任何股票数据 这通常是由于特征工程失败或数据格式问题导致的。我们需要添加更健壮的错误处理机制: 1. 在数据加载阶段添加格式验证 2. 在特征工程阶段添加异常捕获 3. 确保即使部分股票失败,也能处理其他股票 修改数据加载和特征工程部分: ```python # 修改数据加载函数 def load_stock_data(sh_path, sz_path, start_date, end_date): """加载股票数据,并过滤日期范围""" stock_data = {} total_files = 0 # 统计总文件数 for exchange, path in [('SH', sh_path), ('SZ', sz_path)]: if os.path.exists(path): total_files += len([f for f in os.listdir(path) if f.endswith('.csv')]) pbar = tqdm(total=total_files, desc='加载股票数据') for exchange, path in [('SH', sh_path), ('SZ', sz_path)]: if not os.path.exists(path): continue for file in os.listdir(path): if file.endswith('.csv'): stock_code = f"{exchange}{file.split('.')[0]}" file_path = os.path.join(path, file) try: # 读取数据并验证列名 df = pd.read_csv(file_path) # 验证必要的列是否存在 required_cols = ['date', 'open', 'high', 'low', 'close', 'volume'] if not all(col in df.columns for col in required_cols): print(f"股票 {stock_code} 缺少必要列,跳过") continue # 转换日期并过滤 df['date'] = pd.to_datetime(df['date']) df = df[(df['date'] >= start_date) & (df['date'] <= end_date)] if len(df) > 100: # 至少100个交易日 # 转换数据类型 for col in ['open', 'high', 'low', 'close']: # 确保是数值类型 df[col] = pd.to_numeric(df[col], errors='coerce') df[col] = df[col].astype(np.float32) df['volume'] = pd.to_numeric(df['volume'], errors='coerce') df['volume'] = df['volume'].astype(np.uint32) # 删除包含NaN的行 df = df.dropna(subset=required_cols) if len(df) > 0: stock_data[stock_code] = df except Exception as e: print(f"加载股票 {stock_code} 失败: {str(e)}") pbar.update(1) pbar.close() print(f"成功加载 {len(stock_data)} 只股票数据") return stock_data # 修改特征工程中的异常处理 class FeatureEngineer: def transform(self, df): try: # ... 特征计算代码 ... except Exception as e: print(f"特征工程失败: {str(e)}") # 返回基本特征 df['price_change'] = df['close'].pct_change().fillna(0) df['volatility'] = df['close'].rolling(5).std().fillna(0) df['volume_change'] = df['volume'].pct_change().fillna(0) df['MA5'] = df['close'].rolling(5).mean().fillna(0) df['MA20'] = df['close'].rolling(20).mean().fillna(0) # 填充缺失的技术指标 for col in ['RSI14', 'MACD', 'MACD_signal', 'MACD_hist', 'BB_upper', 'BB_middle', 'BB_lower']: if col not in df.columns: df[col] = 0 return df ``` ### 完整修复后的主程序 ```python # 在原有程序中应用上述修复 # ========== 主程序 ========== def main(): # 初始化配置 config = StockConfig() # 加载训练数据 print(f"加载训练数据: {config.START_DATE} 至 {config.END_DATE}") train_data = load_stock_data(config.SH_PATH, config.SZ_PATH, config.START_DATE, config.END_DATE) if not train_data: print("错误: 没有加载到任何股票数据,请检查数据路径和格式") return # 特征工程 feature_engineer = FeatureEngineer(config) # 聚类分析 cluster_model = StockCluster(config) try: cluster_model.fit(train_data) except Exception as e: print(f"聚类分析失败: {str(e)}") # 创建默认聚类映射 cluster_model.cluster_map = {code: 0 for code in train_data.keys()} print("使用默认聚类(所有股票归为同一类)") # 准备训练数据 trainer = StockModelTrainer(config) try: X_train, y_train = trainer.prepare_dataset(train_data, cluster_model, feature_engineer) except ValueError as e: print(f"准备训练数据失败: {str(e)}") # 尝试使用更简单的特征 print("尝试使用基本特征...") config.PREDICT_FEATURES = ['open', 'high', 'low', 'close', 'volume', 'cluster'] X_train, y_train = trainer.prepare_dataset(train_data, cluster_model, feature_engineer) if len(X_train) == 0: print("错误: 没有可用的训练数据") return # 训练模型 model = trainer.train_model(X_train, y_train) # 加载测试数据 print(f"\n加载测试数据: {config.TEST_START} 至 {config.TEST_END}") test_data = load_stock_data(config.SH_PATH, config.SZ_PATH, config.TEST_START, config.TEST_END) if test_data: # 准备测试数据 X_test, y_test = trainer.prepare_dataset(test_data, cluster_model, feature_engineer) # 评估模型 y_pred = model.predict(X_test) recall = recall_score(y_test, y_pred, pos_label=1) print(f"测试集召回率: {recall:.4f}") # 计算满足条件的样本比例 condition_ratio = sum(y_test == 1) / len(y_test) print(f"满足条件的样本比例: {condition_ratio:.4f}") else: print("没有测试数据可用") if __name__ == "__main__": main() ``` ### 关键修复点解释 1. **数据类型转换修复**: ```python # 创建临时副本用于TA-Lib计算 df_temp = df.copy() for col in ['open', 'high', 'low', 'close']: df_temp[col] = df_temp[col].astype(np.float64) ``` - 创建临时DataFrame并转换为float64以满足TA-Lib要求 - 原始数据保持float32节省内存 2. **数据验证增强**: ```python # 验证必要的列是否存在 required_cols = ['date', 'open', 'high', 'low', 'close', 'volume'] if not all(col in df.columns for col in required_cols): print(f"股票 {stock_code} 缺少必要列,跳过") continue # 确保是数值类型 df[col] = pd.to_numeric(df[col], errors='coerce') ``` - 检查必要列是否存在 - 使用`pd.to_numeric`强制转换数值类型 - 删除包含NaN的行 3. **健壮的错误处理**: ```python try: # 特征计算 except Exception as e: print(f"特征工程失败: {str(e)}") # 返回基本特征 df['price_change'] = ... ``` - 捕获特征工程中的异常 - 提供回退方案(基本特征) - 填充缺失的技术指标 4. **备用方案**: ```python # 聚类失败时使用默认聚类 cluster_model.cluster_map = {code: 0 for code in train_data.keys()} # 特征工程失败时使用基本特征 config.PREDICT_FEATURES = ['open', 'high', 'low', 'close', 'volume', 'cluster'] ``` - 聚类失败时将所有股票归为同一类 - 特征工程失败时仅使用基本价格特征 5. **数据可用性检查**: ```python if not train_data: print("错误: 没有加载到任何股票数据,请检查数据路径和格式") return if len(X_train) == 0: print("错误: 没有可用的训练数据") return ``` - 在关键步骤检查数据可用性 - 提供明确的错误信息 ### 预防性措施 1. **数据预处理脚本**: 创建一个单独的数据验证脚本,确保所有CSV文件格式正确: ```python import pandas as pd import os def validate_stock_data(directory): for file in os.listdir(directory): if file.endswith('.csv'): path = os.path.join(directory, file) try: df = pd.read_csv(path) # 验证列名 required = ['date', 'open', 'high', 'low', 'close', 'volume'] if not all(col in df.columns for col in required): print(f"文件 {file} 缺少必要列") # 验证数据类型 for col in required: pd.to_numeric(df[col], errors='raise') except Exception as e: print(f"文件 {file} 验证失败: {str(e)}") # 验证上证和深证数据 validate_stock_data(r"D:\股票量化数据库\股票csv数据\上证") validate_stock_data(r"D:\股票量化数据库\股票csv数据\深证") ``` 2. **日志记录**: 添加详细日志记录,便于追踪问题: ```python import logging logging.basicConfig( filename='stock_prediction.log', level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s' ) # 在代码中使用 try: # 某些操作 except Exception as e: logging.error(f"处理股票 {stock_code} 失败: {str(e)}", exc_info=True) ``` 3. **逐步调试模式**: ```python DEBUG_MODE = True # 设置为False关闭调试模式 if DEBUG_MODE: # 只处理少量股票 test_codes = list(train_data.keys())[:10] train_data = {code: train_data[code] for code in test_codes} ``` 这些修复应该能解决您遇到的 "input array type is not double" 错误和数据合并失败问题,使程序能够成功运行。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值