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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

在 pandas .p??lot() 函數(shù)中禁用科學(xué)記數(shù)法和偏移量

在 pandas .p??lot() 函數(shù)中禁用科學(xué)記數(shù)法和偏移量

catspeake 2023-05-16 16:49:24
我有一個(gè)數(shù)據(jù)框 df,其中有 2 列我想一起繪制,天數(shù)作為索引:           | col1  | col2   | col3 | ...2020-01-01 | 1     | 300000 | ...2020-01-02 | 1000  | 600000 | ...2020-01-03 | 3000  | 50000  | ...通過(guò)繪制 col1 + col2df[["col1", "col2"]].plot()顯示從 0 到 1.0 和頂部“1e6”的值,如本示例所示: https: //i.stack.imgur.com/tJjgX.png我想要 y 軸上的完整值范圍,沒(méi)有科學(xué)記數(shù)法。我怎樣才能通過(guò) pandas .plot() 或 matplotlib 做到這一點(diǎn)?
查看完整描述

3 回答

?
慕后森

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超5個(gè)贊

您有幾種選擇:


選項(xiàng)一:使用 Matplotlib


axes=fig.add_axes([0,0,1,1])

axes.set_xticks() # with list or range() inside

axes.set_yticks() # with list or range() inside


#You can also label the ticks with your desired values

axes.set_xticklabels() # with list or range() inside

axes.set_yticklabels() # with list or range() inside

選項(xiàng)二:更改 Pandas 設(shè)置


pd.set_option('display.float_format', lambda x: '%.3f' % x)

或者


pd.options.display.float_format = '{:.2f}'.format

我相信選項(xiàng)一更好,因?yàn)槟恍枰糜趫D表并且不一定要修改您的數(shù)據(jù)框列。


查看完整回答
反對(duì) 回復(fù) 2023-05-16
?
慕哥6287543

TA貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超10個(gè)贊

您可以嘗試更改axes.formatter.limits以下屬性rcParams

plt.rcParams["axes.formatter.limits"] = (-5, 12)

如果軸范圍的 log10 小于第一個(gè)或大于第二個(gè),則 Matplotlib 使用科學(xué)記數(shù)法。

您可以自定義所需輸出的下限和上限。


查看完整回答
反對(duì) 回復(fù) 2023-05-16
?
一只名叫tom的貓

TA貢獻(xiàn)1906條經(jīng)驗(yàn) 獲得超3個(gè)贊

用于.set_ylim([min,max])設(shè)置繪圖的 y 軸限制



查看完整回答
反對(duì) 回復(fù) 2023-05-16
  • 3 回答
  • 0 關(guān)注
  • 156 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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