Learn Python

Learn Data Structure & Algorithm

Numpy Introduction

Numpy Array

Numpy Attributes

Numpy generate random numbers

Numpy Slicing

Numpy Concatenate & split

Numpy Insert & delete

Numpy Math

Numpy Condition

Numpy Reshaping

Learn Pandas

Matplotlib

Learn Seaborn

Learn Statistics

Learn Math

Learn MATLAB

Learn Machine learning

Learn Github

Learn OpenCV

Learn Deep Learning

Learn MySQL

Learn MongoDB

Learn Web scraping

Learn Excel

Learn Power BI

Learn Tableau

Learn Docker

Learn Hadoop

How to perform condition related work in numpy?

Example:

Input
import numpy as np
x=np.arrange(1,15)
print(x)
y=x>5
z=x[x>5]
e=x[x%2!=0%]
q=x[x%2!=0]=0
r=x[x%!=0]=0
print(x)
print(y)
print(z)
print(e)
print(q)
print(r)
Output
[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14]
[ 0 2 0 4 0 6 0 8 0 10 0 12 0 14]
[False False False False False True True True True True True True True True]
[ 6 7 8 9 10 11 12 13 14]
[ 1 3 5 7 9 11 13]
0

CodersAim is created for learning and training a self learner to become a professional from beginner. While using CodersAim, you agree to have read and accepted our terms of use, privacy policy, Contact Us

© Copyright All rights reserved www.CodersAim.com. Developed by CodersAim.