0
0
Data Analysis Pythondata~10 mins

Scatter plots with regression (regplot) in Data Analysis Python - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the seaborn library as sns.

Data Analysis Python
import [1] as sns
Drag options to blanks, or click blank then click option'
Apandas
Bnumpy
Cseaborn
Dmatplotlib
Attempts:
3 left
💡 Hint
Common Mistakes
Importing matplotlib instead of seaborn.
Using pandas or numpy which do not have regplot.
2fill in blank
medium

Complete the code to create a scatter plot with regression line using seaborn's regplot with x='age' and y='income'.

Data Analysis Python
sns.regplot(x='[1]', y='income', data=df)
Drag options to blanks, or click blank then click option'
Asalary
Bage
Cweight
Dheight
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'salary' or other unrelated columns as x.
Swapping x and y variables.
3fill in blank
hard

Fix the error in the code to show the plot after creating the regplot.

Data Analysis Python
sns.regplot(x='age', y='income', data=df)
plt.[1]()
Drag options to blanks, or click blank then click option'
Ashow
Bdisplay
Cplot
Ddraw
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to import matplotlib.pyplot as plt.
Using incorrect function names like plot() or draw().
4fill in blank
hard

Fill both blanks to create a regplot with data from df, plotting 'height' on x and 'weight' on y.

Data Analysis Python
sns.regplot(x='[1]', y='[2]', data=df)
Drag options to blanks, or click blank then click option'
Aheight
Bage
Cweight
Dincome
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping x and y variables.
Using unrelated columns like 'age' or 'income'.
5fill in blank
hard

Fill all three blanks to create a regplot with x='experience', y='salary', and disable the confidence interval.

Data Analysis Python
sns.regplot(x='[1]', y='[2]', data=df, ci=[3])
plt.show()
Drag options to blanks, or click blank then click option'
Aage
Bsalary
CFalse
Dexperience
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong column names for x or y.
Not setting ci parameter correctly.