1/18
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What does the if-statement do?
It controls execution flow, running a code block if and only if the conditional is true
Which code runs when the conditional is false?
The else statement is used to run a block of code only when the preceding if conditional is false
Six comparison operators for Python conditionals?
==, >, >=, <, <=, and !=
Why use parentheses in complex Pandas conditionals?
Parentheses ensure the correct order of evaluation, as Python defaults to combining ANDs (&) before ORs (|)
Keyword to define a new function?
The Python keyword def is used to define a new function
What are variable placeholders in a function called?
These placeholders are called arguments (or parameters)
Make a function argument optional, how?
By setting a default argument value in the function definition ( e.g., def function(arg = value): )
What does the term for standard deviation mean?
Standard Units or Z scores, which indicate how many standard deviations a value is from the average
Function for area left of Z-score?
norm.cdf(z_score) (cumulative distribution function) from typing "from scipy.stats import norm" (norm.ppf for percentages)
Standard normal curve's mean value?
The standard normal curve is centered at 0 and has an average (mean) of 0
Define probability or chance.
The expected percentage of times a certain outcome occurs when a process is repeated over and over
Define event's sample space.
The set of all possible outcomes of that event
Define the probability's complement rule.
P(event)= 1 minus the probability it does not happen
Addition Rule for non-mutually exclusive events?
P(A or B)=P(A)+P(B)−P(A and B) (The subtraction avoids double counting)
Mutually exclusive events: what is P(A and B)?
If events are mutually exclusive (Special Case), P(A and B) is 0
Multiplication Rule for independent events?
P(A and B)=P(A)×P(B)
Multiplication Rule for dependent events?
P(A and B)=P(A)×P(B∣A) (where P(B∣A) is the conditional probability)
Define conditional probability P(B | A).
The probability that event B will occur given that event A has already occurred
Bayes' Rule expresses what probability?
P(B|A)=P(A|B)×(P(B)/P(A))