看板 Python 關於我們 聯絡資訊
各位前輩新年快樂! 最近用Numpy做曲線擬合, 用np.polyfit()得到高次方程式y(x), 而變數x代入y應該要得多個y值, 但小弟用np.polyval(y,x)只能返回一個y值(y1), 因此想請教各位要如何得到其他的y值(y2,y3,y4,.....)呢? 感謝!祝狗年行大運! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.140.44.223 ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1518957287.A.71E.html
fischcheng: ??任何fit出來的函數一個input只對應到一個output啊? 02/19 04:35
fischcheng: 你的x是 array? 02/19 04:36
yougigun: If x is a sequence, then p(x) is returned for each e 02/19 07:42
yougigun: lement of x. 02/19 07:42
vfgce: 用x,y去np.polyfit()得到f多項式,然後np.polyval(f,x)會得 02/19 18:56
vfgce: 到對應的y,我試過沒問題,程式碼附上來看..... 02/19 18:57
AlSaul: https://tinyurl.com/ya4hf53y 03/01 23:44
AlSaul: https://tinyurl.com/ya4hf53y 03/01 23:54
ar54971: https://goo.gl/2WCUGr 03/06 03:40
galeondx: https://goo.gl/cybm9m 03/06 04:18
galeondx: https://goo.gl/MKaCK6 03/06 04:31
galeondx: https://tinyurl.com/yadsk3lo 03/06 04:43