在pandas.DataFrame
在0.19有兩種方法HIST:pandas.DataFrame:.hist()VS .plot.hist()方法
起初我還以爲他們是同樣的,但實際上他們採取不同的參數。是一個會在未來的版本中被取消,是否有不同的使用情況爲每個,或者有什麼故事?
在pandas.DataFrame
在0.19有兩種方法HIST:pandas.DataFrame:.hist()VS .plot.hist()方法
起初我還以爲他們是同樣的,但實際上他們採取不同的參數。是一個會在未來的版本中被取消,是否有不同的使用情況爲每個,或者有什麼故事?
望着文檔,http://pandas.pydata.org/pandas-docs/version/0.17.0/generated/pandas.DataFrame.plot.hist.html和http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.hist.html,它看起來像plot.hist
是一個函數,需要幾直方圖具體方案,但隨後經過對所有其他關鍵字參數傳遞給plot()
,而HIST直接花費大量關鍵字參數的個數。我想這主要是爲了創建一個更簡單,更一致的API,而不是具有15個不同的功能,每個功能都需要大量的kwargs
,只關注專門的參數,其餘與plot()
一致
cf :
在新版本0.17.0或更新:每個情節種類對 的相應方法的DataFrame.plot存取:df.plot(種類= '線')相當於 df.plot.line()
另外, N,情節*函數返回axes
,這可能是鏈接和其他有用的東西。
實際上舊式函數返回的軸以及 – maxymoo
沒錯,但如果有多個列返回軸的陣列,而不是(如在另一個答案指出),所以它可能不會是鏈接一樣方便。 – OldGeeksGuide