我从源代码构建了OpenCV 3.1.0,当我在Python中尝试import cv2
时,我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so: undefined symbol: _ZN2cv9Algorithm7getListERSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE
操作系统是Ubuntu 16.04 LTS。我跟着this guide to build OpenCV with CUDA 8.0。
答案 0 :(得分:0)
安装glib!
例如,如果您使用Anaconda,请运行以下命令:
var arr = [{"id":"1","series":{"eoy":[10,20,30,40,50,60],"eom":[20,30,40,50,60],"now":[30,40,50,60,70,80]}},{"id":"2","series":{"eoy":[30,40,20,50,10],"eom":[20,10,50,70,20,50],"now":[30,10,70,20]}}]; let result = arr.reduce((a, c) => { /* For each item in the array, iterate over each entry ** in series and sum it in the accumulator object. */ Object.entries(c.series).forEach(([k, v]) => { a[k] = a[k] || []; v.forEach((n, i) => a[k][i] = a[k][i] ? a[k][i] + n : n); }); return a; }, {}); console.log(result);