pykalmanを直す

pykalmanをいんすとーるしてsampleのplot_em.pyを実行したら怒られた。

$ python plot_em.py 
<class 'numpy.ma.core.MaskedArray'>
Traceback (most recent call last):
  File "plot_em.py", line 65, in <module>
    loglikelihoods[i] = kf.loglikelihood(data.observations)
    〜〜〜略〜〜〜
    .direnv/python-3.6.3/lib/python3.6/site-packages/scipy/_lib/_util.py", line 236, in _asarray_validated
    raise ValueError('masked arrays are not supported')
ValueError: masked arrays are not supported

scipy先生にmaske arrayはダメだぞと言われている。

standard.pyの1529行目 _parse_observations関数を直した。
コメントの部分はもともとの。
ndarrayに加工できれば何でもええやろとnp.arrayで囲った。

    def _parse_observations(self, obs):
        """Safely convert observations to their expected format"""
        # obs = np.ma.atleast_2d(obs)
        obs = np.array(np.ma.atleast_2d(obs))
        if obs.shape[0] == 1 and obs.shape[1] > 1:
            obs = obs.T
        return obs