본문 바로가기
Python

[python] NumPy where,Multiple conditions

by Chandler.j 2021. 10. 19.
반응형

output = array[np.where((array < condition1) | (array > condition2))]

output = array[np.where((array > condition1) & (array < condition2))]

 

 

ref:https://www.kite.com/python/answers/how-to-use-numpy-where-with-multiple-conditions-in-python

 

Kite - Free AI Coding Assistant and Code Auto-Complete Plugin

Code faster with Kite’s AI-powered autocomplete plugin for over 16 programming languages and 16 IDEs, featuring Multi-Line Completions. Works 100% locally.

www.kite.com

 


TOP

Designed by 티스토리