Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
Write a Numpy program to create an array to 10 zeros,10 ones,10 fives.
Home
Education
Write a Numpy program to create an array to 10...
asked
Dec 12, 2021
in
Education
by
JackTerrance
Write a Numpy program to create an array to 10 zeros,10 ones,10 fives. Select the correct answer from above options
computer-science-interview-questions
computer-science-questions
1
Answer
0
votes
answered
Dec 12, 2021
by
JackTerrance
Best answer
Answer: Explanation: import numpy as np array=np.zeros(10) print(“An array of 10 zeros:”) print(array) array=np.ones(10) print(“An array of 10 ones:”) print(array) array=np.ones(10)*5 print(“An array of 10 fives:”) print(array) Sample Output:An array of 10 zeros: [ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.] An array of 10 ones: [ 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.] An array of 10 fives: [ 5. 5. 5. 5. 5. 5. 5. 5. 5. 5.]
Related questions
0
votes
Q: write a Java program to input 10 non-zero numbers in an array and display the count of even and odd numbers.
write a Java program to input 10 non-zero numbers in an array and display the count of even and odd numbers. URGENT! Select the correct answer from above options...
asked
Dec 31, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program to store 10 names in an array. Arrange these in alphabetical orderby sorting. Print the sorted list.Take single word names, all in capital letters, e.g. SAMSON, AJAY, LUCY, etc.
Write a program to store 10 names in an array. Arrange these in alphabetical orderby sorting. Print the sorted list. ... , LUCY, etc. Select the correct answer from above options...
asked
Dec 12, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a program in java to accept a number and display the new number after removing all the zeros
write a program in java to accept a number and display the new number after removing all the zeros Select the correct answer from above options...
asked
Dec 10, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a program to print fibonacci series . write a program to search an element within the array using binary search
write a program to print fibonacci series . write a program to search an element within the array using binary search Select the correct answer from above options...
asked
Dec 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a c program to find largest and smallest among all elements of 2-d array.
Write a c program to find largest and smallest among all elements of 2-d array. Select the correct answer from above options...
asked
Dec 21, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program to eliminate duplicates in a sorted array. in python
Write a program to eliminate duplicates in a sorted array. in python Select the correct answer from above options...
asked
Dec 17, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program to generate first 20 terms of Fibonacci series and store them in single dimension array. Display the prime Fibonacci numbers from the array
Write a program to generate first 20 terms of Fibonacci series and store them in single dimension array. Display ... from the array Select the correct answer from above options...
asked
Dec 10, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program to generate the following series:11,22,33,44……………….upto 10 terms.
Write a program to generate the following series: 11,22,33,44……………….upto 10 terms. (Note:- it’s is based on Qbasic64) Select the correct answer from above options...
asked
Dec 31, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and print all palindrome words in the sentence present. Java class 10
write a program to enter a sentence and check if it contains palindrome words or not. if yes then count and ... present. Java class 10 Select the correct answer from above options...
asked
Dec 31, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program to read name of 10 student from keyboard and arrange them alphabetically.
Write a program to read name of 10 student from keyboard and arrange them alphabetically. Select the correct answer from above options...
asked
Dec 21, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked
Dec 7, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked
Dec 5, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Plz write a program for the following pattern in Java class 10 ICSE2 6 12 20 30 424 6 8 10 122 2 2 20 0 0000
Plz write a program for the following pattern in Java class 10 ICSE 2 6 12 20 30 42 4 6 8 10 12 2 2 2 ... spam. Answer only if you know Select the correct answer from above options...
asked
Nov 30, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: 6. A business man wishes to accumulate 3000 shares of a company. However, healready has some shares of that company valuing * 10 (nominal value) whichyield 10% dividend per annum and receive 2000 as dividend at the end ofthe year. Write a program in Java to calculate the number of shares he has andhow many more shares to be purchased to make his target.
6. A business man wishes to accumulate 3000 shares of a company. However, he already has some shares of that ... 100/Nominal value*div% Select the correct answer from above options...
asked
Nov 27, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked
Nov 26, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
...