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
Computer professionals known as software engineers, or Blank______, use the software development life cycle to create software r
Aloiza [94]

Answer:

Computer professionals known as software engineers, or programmers use the software development life cycle to create software required for information systems.

Explanation:

Computer professionals are called software engineers and programmers because they develop and program software. Some additional titles for computer professionals are hardware engineers and iOS/Android developers.

5 0
2 years ago
____ map a set of alphanumeric characters and special symbols to a sequence of numeric values that a computer can process.
Neporo4naja [7]
The answer is : coding schemes
4 0
3 years ago
Where does blood travel when it leaves the right ventricle of the heart
tensa zangetsu [6.8K]
The right ventricle contracts, and blood is forced through the pulmonary semilunar valve into the pulmonary artery. It then travels to the lungs. Hope this helps!
3 0
2 years ago
Read 2 more answers
Which transmission media is faster? Fibre Optic or Radio-waves? I want full explanation!
Bad White [126]

Answer:

Due to the direct line of sight,the data rate of radio links is higher than that of fiber optic connections. A radio link has a lower latency (less delay).In contrast ,fiber optic connections may achieve higher bandwidths

4 0
3 years ago
Which of the following types of memory is used to load programs and transfer files during your work sessions? A. D-ROM B. RAM C.
hammer [34]
I believe the answer is B-Ram <span />
4 0
3 years ago
Read 2 more answers
Other questions:
  • 2. Identify the diagram and define it.<br>13. What are pollen grains ?<br>4. What is an embryo?​
    12·1 answer
  • How many answer or point do I answer/need to sent message?
    6·1 answer
  • Dynamically allocatе mеmory for a DNA objеct and storе its addrеss in a variablе namеd dnaPtr
    11·1 answer
  • Kiera is building a new computer and wants to make sure she has an adequate power supply for all the new equipment she is purcha
    15·2 answers
  • Please help!!
    8·1 answer
  • i set up an account and paid the yearly fee, now it's asking me to join. i've tried to log in and brainly isn't accepting my ema
    8·1 answer
  • The objects that you place on master pages are called _____.
    6·1 answer
  • The characteristics of Computer Graphics<br><br>FUEL YOUR<br>GREATNESS​
    9·1 answer
  • How do I type over Images (photo posted ​
    12·2 answers
  • What is the code for this please?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!