I am trying to get the elements in an ndarray that are strings. That is, exclude the elements that are integers and floats.
Lets say I have this array:
x = np.array([1,'hello',2,'world'])
I want it to return:
array(['hello','world'],dtype = object)
I've tried doing np.where(x == np.str_)
to get the indices where that condition is true, but it's not working.
Any help is much appreciated.