0
0
NumPydata~5 mins

Covariance with np.cov() in NumPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the np.cov() function calculate?
It calculates the covariance matrix, which shows how two or more variables change together.
Click to reveal answer
beginner
What is covariance in simple terms?
Covariance measures if two variables increase or decrease together. Positive means they move together, negative means opposite.
Click to reveal answer
intermediate
How do you interpret a covariance matrix output from np.cov()?
The diagonal shows variance of each variable. Off-diagonal values show covariance between pairs of variables.
Click to reveal answer
intermediate
What does setting rowvar=False in np.cov() do?
It tells np.cov() that each column represents a variable, and rows are observations.
Click to reveal answer
beginner
Why is covariance important in data science?
It helps understand relationships between variables, which is key for analysis and building models.
Click to reveal answer
What does a positive covariance between two variables indicate?
AThey increase or decrease together
BThey move in opposite directions
CThey are independent
DThey have no relationship
In np.cov(), what does the default rowvar=True mean?
ACovariance is scaled
BEach row is a variable
CData is normalized
DEach column is a variable
What shape is the output of np.cov() when given two variables?
A2x1 matrix
B1x2 matrix
C2x2 matrix
DScalar value
Which numpy function is used to calculate covariance?
Anp.mean()
Bnp.std()
Cnp.var()
Dnp.cov()
If covariance between two variables is zero, what does it mean?
AVariables have no linear relationship
BVariables are perfectly correlated
CVariables are identical
DVariables have negative correlation
Explain what covariance is and how np.cov() helps calculate it.
Think about how two variables move together and how numpy shows this.
You got /4 concepts.
    Describe how to use np.cov() with a dataset where each column is a variable and each row is an observation.
    Remember the parameter that changes how variables are read.
    You got /3 concepts.