使用 Lodash 使用索引从对象中删除项目

问题描述

我有一个这样的对象:

[
  [
    'gfhasd','0x0000000000000000000000000000000000000000','3000000000000000000','0','0x',component: 'rgr',module: '0x0000000000000000000000000000000000000000',unit: '5000000000000000000',positionState: '0',data: '0x'
  ],[
    'zaradf','500000000',component: 'xyx',unit: '500000000',data: '0x'
  ]
]

我希望删除每个项目的索引 0、1、2、3、4,因为它们是重复的。

我正在用 lodash 尝试类似的东西,但它不起作用:

const pos = _.remove(positions,(item) => item[i] == 0)

解决方法

我设法使用以下代码修复它:

import numpy as np
import cv2
import os from sklearn.cluster 
import MiniBatchKMeans from sklearn.linear_model 
import SGDClassifier 
import time 
from functions.Cenangles import get_center_and_theta_proportional,Paint_lines,get_center_and_theta_threshold 
from realsense.camera_d400_v2 import Camera_D400 import fastcom.Publisher import fastcom.ImagePublisher 
import struct 
import signal