Removing duplicate columns and rows from a NumPy 2D array

后端 未结 6 1779
别那么骄傲
别那么骄傲 2020-11-29 04:55

I\'m using a 2D shape array to store pairs of longitudes+latitudes. At one point, I have to merge two of these 2D arrays, and then remove any duplicated entry. I\'ve been se

6条回答
  •  误落风尘
    2020-11-29 05:33

    The numpy_indexed package (disclaimer: I am its author) wraps the solution posted by user545424 in a nice and tested interface, plus many related features:

    import numpy_indexed as npi
    npi.unique(coordskeys)
    

提交回复
热议问题