← 返回题库
初级

Default数据集探索性分析

未完成
初级参考 完整示例代码供参考,建议自己理解后重新输入
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
default = pd.read_csv('https://liangdaima.com/static/data/statistics/Default.csv')
print(default.describe())
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
sns.countplot(x='default', data=default, ax=axes[0])
axes[0].set_title('Default频数统计')
sns.countplot(x='student', data=default, ax=axes[1])
axes[1].set_title('Student频数统计')
plt.show()

示例

输入
solve()
期望输出
Unnamed: 0       balance        income
count  10000.00000  10000.000000  10000.000000
mean    5000.50000    835.374886  33516.981876
std     2886.89568    483.714985  13336.639563
min        1.00000      0.000000    771.967729
25%     2500.75000    481.731105  21340.462903
50%     5000.50000    823.636973  34552.644802
75%     7500.25000   1166.308386  43807.729272
max    10000.00000   2654.322576  73554.233495
Python 代码 🔒 登录后使用
🔒

登录后即可练习

注册免费账号,在浏览器中直接运行 Python 代码