1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
spayn [35]
3 years ago
13

Write a python function genRandomVect that returns a random 1d numpy array of size (50,) where each element is an integer sample

d from [0, 100) and no two elements in the vector are the same.
Your code snippet should define the following variable:

Name Type Description
genRando function function that returns a numpy array of shape (50,) that
contains random elements on the interval [0, 100) and
no duplicates
Computers and Technology
1 answer:
SSSSS [86.1K]3 years ago
6 0

Answer:

import numpy as np

def genRandomVect():

   arr = np.random.choice(range(100),size=(50,),replace=False)

   return arr

 

print("Random 1D numpy array where each element is an integer sampled from: [0, 100) ")

print( genRandomVect() )

Explanation:

  • Create a function to create a numpy array with random integers in range[0,100) with no duplicates
  • Use the random.choice to select random values from range[0,100)  and size attribute to take the size of the required array .
  • Finally return the numpy array.

You might be interested in
Which of the following components helps to limit the front-to-back movement of the crankshaft? 
iris [78.8K]
The correct answer is A. The thrust bearing

It is used to help limit the front-to-back movement of the crankshaft.
5 0
3 years ago
Read 2 more answers
Suppose that a CPU scheduling algorithm favors those processes that have used the least processor time in the recent past. Why w
avanturin [10]

Answer:

I/O bound programs will be favored due to the CPU burst request of the I/O programs. This is because their CPU burst request is short and would release the CPU within a short period.

Due to the brief request time of the I/O programs on the CPU, CPU-bound programs will not be permanently starved. After a little while, CPU resources will be released to the CPU-bound programs for use.

6 0
3 years ago
3. What role can the school play in order to avoid and act against cyber bullying?​
Snowcat [4.5K]

Answer:

below

Explanation:

really nothing because you cant prevent cyberbullying in any way its going to happen at anytime anywhere you can act against it by doing a orginazation to try and prevent it.

6 0
3 years ago
PLEASE HELP WITH THESE QUESTIONS!!!! 19 POINTS!!!!!
Anton [14]
1. C.) Macintosh
2. B.) Semiconductor
3. D.) Microchip
8 0
3 years ago
Read 2 more answers
In Windows applications, a ____ control is commonly used to perform an immediate action when clicked.a. text boxb. buttonc. wind
AleksandrR [38]

Answer:

Option b. button

Explanation:

Button control is one of the most common user controls in Windows application to enable user perform an immediate action when clicked. We can see there might be more than one button controls in a single Window application and each of them can be used to trigger different specific action.

For example, button control can be created to perform a "Submit" or "Login", or "Calculate" action in Windows application. The button click event will trigger a corresponding action to meet a specific purpose.

7 0
3 years ago
Other questions:
  • What is the purpose of this diamond shape in a flowchart?
    8·1 answer
  • Why is linux referred to as open source software?
    6·1 answer
  • Access Office Equipment has shifted to sales and service of laptops and PCs, where it has the potential to triple the number of
    15·1 answer
  • Which hardware component is most suspect if a user can barely make out
    10·1 answer
  • The following program segment is designed to compute the product of two nonnegative integers X and Y by accumulating the sum of
    9·1 answer
  • Suggest why people might not want the government to carry out Internet surveillance?​
    8·2 answers
  • Creation of ____________will help you to study the behavior of the real system
    11·1 answer
  • What factors do network consultants consider when determining the network needs of a business? Use the space provided below to a
    6·1 answer
  • Challenge activity 1.11.1: using constant in expression is not working for me. Can any one help me find the right code?
    12·1 answer
  • 4 brainly
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!