Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to check if column of NumPy array contains specific string?

$
0
0

Let's assume I have an NumPy array:

contacts = np.array([    ["Apples","Burger"],    ["Bananas","Cake"],    ["Grapes","Honey"]])

Now, I want to find at which position "Banana" is and clear the entire column, so the array turns into this:

contacts = np.array([    ["Burger"],    ["Cake"],    ["Honey"]])

How can I do this with code?


Viewing all articles
Browse latest Browse all 23131

Trending Articles