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
If they spend all night writing computer programs, Laurence can write 10 programs while Carrie Anne can write 5. If they spend a
kondaur [170]

Answer:

Laurence can write 10 programs while Carrie Anne can write 5.

Laurence can make 6 sunglasses while Carrie Anne can make 4

Explanation:

3 0
2 years ago
How are the two parts of an ip address determined?
Shkiper50 [21]
You can determine the network number by bitwise and'ing the netmask and address. The node number needs the bits of the netmask flipped and then bitwise and'ed.
3 0
3 years ago
Question 13(Multiple Choice Worth 5 points)
m_a_m_a [10]

Answer:

Option 2: Insert is the correct answer.

Explanation:

Word processing software provides with the options required to create and format documents. A document may consist of text, images, shapes, tables etc.

The insert tab is used to insert tables, images and shapes in the document.

Hence,

Option 2: Insert is the correct answer.

3 0
2 years ago
What is .net formatting?
SCORPION-xisa [38]
Basically replacing a certain formatting for a certain product 
8 0
3 years ago
Read 2 more answers
Consider the following code segment:
prisoha [69]

ArrayLists are arrays that can be resized

The list that represents the value of nums after executing the code segments is [20, 30, 90, 50]

<h3>How to determine the value of the list</h3>

From lines 1 to 5 of the program, the content of the nums list is:

nums = [10, 20, 30, 40, 50]

Next, the element at the 3rd index is removed and saved in x.

So, we have:

nums = [10, 20, 30, 50]

x= 40

Next, the element at the 0 index is removed and then added to x.

The result is then saved in y

So, we have:

nums = [20, 30, 50]

y= 50

x = 40

The values of x and y are added and then inserted at the 2nd index of the arraylist.

So, we have:

nums = [20, 30, 90, 50]

Hence, the list that represents the value of nums is [20, 30, 90, 50]

Read more about arraylists at:

brainly.com/question/26264399

8 0
2 years ago
Other questions:
  • Alexa hoped that a good outline will accomplish which of the following for her<br> presentation?
    12·2 answers
  • You use the _____ sheet in the format cells dialog box to position data in a cell by centering it, for example.​
    8·1 answer
  • Write down a program in SNOBOL thatcalculates the factorial of 7.
    10·1 answer
  • Given a String variable named sentence that has been initialized, write an expression whose value is the number of characters in
    13·1 answer
  • Does the Main Content (MC) of a web page include searchboxes?
    8·2 answers
  • ¿que lenguaje de programacion usan los operadores matematicos?​
    9·2 answers
  • Which of the following is NOT a data type in Python?<br> integer<br> decimal<br> string<br> float
    15·1 answer
  • Koi friend online hai kya​
    15·1 answer
  • Use the drop-down menus to explain what happens when a manager assigns a task in Outlook.
    6·2 answers
  • What is the Digital Living Network Alliance ?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!