1 回答

TA貢獻(xiàn)1858條經(jīng)驗(yàn) 獲得超8個(gè)贊
這是您要實(shí)現(xiàn)的目標(biāo)的示例:
fig, ax = plt.subplots(2, 2, figsize=(20, 10))
# hide axes
# fig.patch.set_visible(False)
ax[0][0].axis('off')
ax[0][1].axis('off')
ax[0][1].axis('tight')
ax[0][0].axis('tight')
df = pd.DataFrame(np.random.rand(10, 4), columns=list('ABCD'))
ax[0][0].table(cellText=df.head().values, colLabels=df.columns, loc='center')
ax[0][1].table(cellText=df.describe().values, colLabels=df.describe().columns, rowLabels=df.describe().index, loc='center')
df.plot(kind='hist', ax=ax[1][0])
df.plot(kind='box', ax=ax[1][1])
fig.tight_layout()
plt.show()
添加回答
舉報(bào)