Answer Key
University
American Baptist CollegeCourse
CSCI 1534 | Data Analysis and VisualizationPages
2
Academic year
2023
Muthia Marhamah
Views
0
Answer this question. 1. If you want to replace all 'math score' values below 50 with the median values, which of the following commands would you use? A. df['math score'] = df['math score'].apply('math score'.median()) B. df.loc[df['math score'] < 50, 'math score'] = df['math score'].median() C. df['math score'] < 50 = df['math score'].median() D. df['math score'].replace(df['math score'] < 50, df['math score'].median()) 2. How would you find the Interquartile Range (IQR) for 'math score' using Pandas? A. np.percentile(df['math score'], [75, 25]) B. df['math score'].describe() C. df['math score'].quantile(0.75) - df['math score'].quantile(0.25)
D. df['math score'].quantile([0.25, 0.75]) 3. Should you want to visualize the relationship between 'reading score' and 'writing score' for each 'gender' category, which Seaborn command would be most appropriate? A. sns.scatterplot(x='reading score', y='writing score', hue='gender', data=df) B. sns.pairplot(df, hue='gender') C. sns.relplot(x='reading score', y='writing score', hue='gender', data=df) D. sns.boxplot(x='reading score', y='writing score', hue='gender', data=df) 4. How can you display the 'math score' distribution for each 'gender' category using Seaborn? A. sns.kdeplot(data=df, x='math score', hue='gender') B. sns.distplot(df['math score'], hue=df['gender']) C. sns.boxplot(x='gender', y='math score', data=df) D. sns.violinplot(x='gender', y='math score', data=df)
Quiz 11 Python for Data Analyst
Please or to post comments