Skip to main content

Find occurences in an array

How to find occurences in python arrays and remove them

In [ ]:
import collections
In [ ]:
print([item for item, count in collections.Counter(esf_x).items() if count > 1])
In [ ]:
import collections
item = collections.Counter(esf_x).items()
In [ ]:
ind_array = []
for i in item:
 ind= (np.where(esf_x == i[0]))[0][0]
 ind_array.append(ind)
In [ ]:
esf_x = np.delete(esf_x,ind_array)
esf_y = np.delete(esf_y,ind_array)