- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Finding the multiples of a number in a given list using NumPy

In this program, we will find the index position at which a multiple of a given number exists. We will use both the Numpy and the Pandas library for this task.

## Algorithm

Step 1: Define a Pandas series. Step 2: Input a number n from the user. Step 3: Find the multiples of that number from the series using argwhere() function in the numpy library.

## Example Code

import numpy as np listnum = np.arange(1,20) multiples = [] print("NumList:

",listnum) n = int(input("Enter the number you want to find multiples of: ")) for num in listnum: if num % n == 0: multiples.append(num) print("Multiples of {} are {}".format(n, multiples))

## Output

NumList: [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19] Enter the number you want to find multiples of: 5 Multiples of 5 are [5, 10, 15]

- Related Questions & Answers
- Finding the number of rows and columns in a given matrix using Numpy
- Finding next prime number to a given number using JavaScript
- Finding sum of multiples in JavaScript
- Python program to print elements which are multiples of elements given in a list
- Print multiples of Unit Digit of Given Number in C Program
- Finding the matching number of a graph
- Return mantissa and exponent as a pair of a given list in Numpy
- Finding closest pair sum of numbers to a given number in JavaScript
- Finding the line covering number of a graph
- Finding the number of spanning trees in a graph
- Finding the number of words in a string JavaScript
- Finding the Parity of a number Efficiently in C++
- Finding the length of words in a given Pandas series
- Finding the count of numbers divisible by a number within a range using JavaScript
- Finding square root of a number without using Math.sqrt() in JavaScript

Advertisements