マスクされた配列 の numpy 多項式近似関数は、ma.polyfit
整数入力でクラッシュします。
import numpy.ma as ma
x = ma.arange(2)
y = ma.arange(2)
p1 = ma.polyfit(np.float32(x), y, deg=1)
p2 = ma.polyfit( x , y, deg=1)
最後の行でエラーが発生します。
ValueError: data type <type 'numpy.int64'> not inexact
整数の x 値でデータを適合できないのはなぜですか (通常のnumpy.polyfit
関数では問題ありません)。これは (既知の) バグですか?