第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

保存pandas dataframe head(5)、統(tǒng)計、plot為圖片輸出

保存pandas dataframe head(5)、統(tǒng)計、plot為圖片輸出

楊魅力 2023-02-22 16:49:02
有什么辦法可以將它們另存為 png 或其他圖像輸出嗎?輸出圖像需要包括:df.head(5)df[column].describe()distribution plotor histogram plot(或任何其他情節(jié)......)
查看完整描述

1 回答

?
猛跑小豬

TA貢獻(xiàn)1858條經(jīng)驗 獲得超8個贊

這是您要實現(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()

http://img1.sycdn.imooc.com//63f5d9480001481914380719.jpg

查看完整回答
反對 回復(fù) 2023-02-22
  • 1 回答
  • 0 關(guān)注
  • 248 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號