Categories
data science FAQ's

How to find the positions of numbers that are multiple of 4 from a series?

For finding the multples of 4, we will use the argwhere() function. First, we will create a list of 10 numbers –

s1 = pd.Series([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])

np.argwhere(ser % 4==0)

Output > [3], [7]

Leave a Reply

Your email address will not be published. Required fields are marked *