Probability & Statistics: Data Handling and Random Values
12 Questions
0 Views

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</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</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</p> Signup and view all the answers

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

    <p>Handling missing values</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()</p> Signup and view all the answers

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

    <p>Between 0 and 5</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</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)</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</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser