Which method in pandas is used to compute pairwise correlation of columns?
A
df.cov() B
df.relate() C
df.compare() D
df.corr()
Analysis & Theory
`df.corr()` computes the pairwise Pearson correlation between numeric columns.
What is the default correlation method used by `df.corr()`?
A
Kendall B
Pearson C
Spearman D
Cosine
Analysis & Theory
By default, `df.corr()` uses the Pearson correlation method.
What does a correlation value of 1.0 imply?
A
No correlation B
Negative correlation C
Perfect positive correlation D
Perfect negative correlation
Analysis & Theory
A correlation value of 1.0 means perfect positive linear correlation.
Which correlation method measures monotonic relationships?
A
pearson B
spearman C
covariance D
kendall
Analysis & Theory
Spearman correlation measures monotonic (not necessarily linear) relationships.
Which of the following will calculate correlation using the Kendall method?
A
df.corr(method='kendall') B
df.kendall() C
df.correlation('kendall') D
df.stats(method='kendall')
Analysis & Theory
Use `df.corr(method='kendall')` to compute Kendall rank correlation.
Which of the following values indicates no correlation?
A
-1 B
0 C
0.5 D
1
Analysis & Theory
A correlation of 0 means no linear relationship between the variables.
Which pandas function is used to compute the covariance matrix?
A
df.corr() B
df.covar() C
df.cov() D
df.var()
Analysis & Theory
`df.cov()` computes the covariance matrix of numeric columns.
What type of data does `df.corr()` ignore by default?
A
String columns B
Float columns C
Integer columns D
All columns
Analysis & Theory
`df.corr()` automatically excludes non-numeric (e.g., string/object) columns.
What is the range of correlation values?
A
0 to 1 B
-1 to 1 C
-∞ to ∞ D
0 to ∞
Analysis & Theory
Correlation values range from -1 (perfect negative) to 1 (perfect positive).
To visualize correlation heatmap, which library is commonly used?
A
pandas.plot B
matplotlib C
seaborn D
numpy
Analysis & Theory
Seaborn is commonly used to create heatmaps with `sns.heatmap(df.corr())`.