The First Experiment
To be a data analyst, it is crucial to understand that we are going to conduct a lot of experiments. Here, we are going to get acquainted with several gripping functions!
Real-life example:
Imagine that we are working for a real estate agency, and we need to know how many positive answers we will get from all interviewees.
In this course, we will learn such interesting functions programming-wise.
Look at the example and everything will be clear:
General formula:
In this experiment, we will work with the binom.pmf(k, n, p) function. This function helps calculate the probability of receiving exactly k successes among n trials with the probability of success for each experiment p.
1234from scipy.stats import binom # Calculate the probability experiment = binom.pmf(k = 1000, n = 20000, p=0.20) print(experiment)
Explanation:
- As usual, we are importing objects from 
scipy.statswith this codefrom scipy.stats import binom. binom.pmf(k = 1000, n = 20000, p=0.20)the probability of getting1000successes amoung20 000trials with the probability of success20%.
Interesting fact:
The result of our code is zero, but we worked with an enormous sample; in the task, we will receive a more understandable result.
Swipe to start coding
Imagine that our task is to do some calculations for a charity organization just for practice.
Your task here is to calculate the probability that exactly 5 kittens will find a home; there are 12 kittens in the shelter. In this city, kittens are taken from a shelter with a probability of 75%. Import relevant library to do it.
- Import 
binomobject fromscipy.stats. - Calculate the probability that exactly 
5kittens out of12will find a home with the probability of success75%. 
The output here is going to be less hopeful.
Solution
Merci pour vos commentaires !
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Awesome!
Completion rate improved to 3.7
The First Experiment
Glissez pour afficher le menu
To be a data analyst, it is crucial to understand that we are going to conduct a lot of experiments. Here, we are going to get acquainted with several gripping functions!
Real-life example:
Imagine that we are working for a real estate agency, and we need to know how many positive answers we will get from all interviewees.
In this course, we will learn such interesting functions programming-wise.
Look at the example and everything will be clear:
General formula:
In this experiment, we will work with the binom.pmf(k, n, p) function. This function helps calculate the probability of receiving exactly k successes among n trials with the probability of success for each experiment p.
1234from scipy.stats import binom # Calculate the probability experiment = binom.pmf(k = 1000, n = 20000, p=0.20) print(experiment)
Explanation:
- As usual, we are importing objects from 
scipy.statswith this codefrom scipy.stats import binom. binom.pmf(k = 1000, n = 20000, p=0.20)the probability of getting1000successes amoung20 000trials with the probability of success20%.
Interesting fact:
The result of our code is zero, but we worked with an enormous sample; in the task, we will receive a more understandable result.
Swipe to start coding
Imagine that our task is to do some calculations for a charity organization just for practice.
Your task here is to calculate the probability that exactly 5 kittens will find a home; there are 12 kittens in the shelter. In this city, kittens are taken from a shelter with a probability of 75%. Import relevant library to do it.
- Import 
binomobject fromscipy.stats. - Calculate the probability that exactly 
5kittens out of12will find a home with the probability of success75%. 
The output here is going to be less hopeful.
Solution
Merci pour vos commentaires !
single