How about
if value in my_array[:, col_num]:
do_whatever
Edit: I think __contains__
is implemented in such a way that this is the same as @detly’s version
More Related Contents:
- Most efficient way to map function over numpy array
- Performance of Pandas apply vs np.vectorize to create new column from existing columns
- Why is numpy’s einsum faster than numpy’s built in functions?
- Link ATLAS/MKL to an installed Numpy
- Fastest way to grow a numpy numeric array
- Implement MATLAB’s im2col ‘sliding’ in Python
- Frequency counts for unique values in a NumPy array
- Python’s sum vs. NumPy’s numpy.sum
- Why “numpy.any” has no short-circuit mechanism?
- Vectorizing Haversine distance calculation in Python
- Pandas pd.Series.isin performance with set versus array
- Numpy and line intersections
- Efficiently detect sign-changes in python
- Efficiently Calculating a Euclidean Distance Matrix Using Numpy
- Efficient way to take the minimum/maximum n values and indices from a matrix using NumPy
- Why list comprehension is much faster than numpy for multiplying arrays?
- Why is `np.sum(range(N))` very slow?
- Numpy vs Cython speed
- numpy float: 10x slower than builtin in arithmetic operations?
- Why is a `for` over a Python list faster than over a Numpy array?
- Performance: Matlab vs Python
- Are NumPy’s math functions faster than Python’s?
- Max in a sliding window in NumPy array
- No speedup when summing uint16 vs uint64 arrays with NumPy?
- Why is Numpy much faster at creating a Zero array compared to replacing the values of an existing array with zeros?
- how to speed up a vector cross product calculation
- Multiple matrix multiplication
- Creating a numpy array of 3D coordinates from three 1D arrays
- Split Python sequence (time series/array) into subsequences with overlap
- numpy faster than numba and cython , how to improve numba code