Probability & Statistics: Data Handling and Random Values

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does np.random.randint(0, 5, 3) produce?

  • Produces an error
  • Gives a 2D array with 5 random integers between 0 and 5
  • Gives an array with 5 random float values
  • Gives 3 random integers between 0 and 5 (correct)

What does np.random.rand(5) produce?

  • Gives 3 random integers between 0 and 5
  • Gives a 2D array with 5 random integers between 0 and 5
  • Gives an array with 5 random float values (correct)
  • Produces an error

What is true about a random outcome?

  • The outcome is not predictable in advance (correct)
  • The distribution of outcomes remains constant
  • It follows a predictable long-term pattern
  • It is always predictable in advance

What must the probabilities of all possible outcomes add up to in a random phenomenon?

<p>Exactly 1 (B)</p> Signup and view all the answers

What does np.random.choice([24,10,12,35,5]) output?

<p>One of the values [24,10,12,35,5] at random (B)</p> Signup and view all the answers

What is important for the probability of an outcome to obey?

<p>Probability must be between 0 and 1 (C)</p> Signup and view all the answers

What is the purpose of 'data cleaning' in the context of this lecture?

<p>Handling missing values (D)</p> Signup and view all the answers

Which numpy method is used to generate a random float value between 0 and 1?

<p>np.random.rand() (A)</p> Signup and view all the answers

What output value range does np.random.randint(0, 5) produce?

<p>Between 0 and 5 (A)</p> Signup and view all the answers

In numpy, what does np.random.randint(0, 5, (2,3)) do?

<p>Generates a 2x3 matrix of random integers between 0 and 5 (B)</p> Signup and view all the answers

What is the difference between np.random.randint(0, 5) and np.random.rand()?

<p>Output type (integer vs float) (B)</p> Signup and view all the answers

What does 'Handling missing values' refer to in the context of this lecture?

<p>Dealing with values that are not present in the dataset (B)</p> Signup and view all the answers

Flashcards are hidden until you start studying

More Like This

Use Quizgecko on...
Browser
Browser