Use asanyarray instead of astype

the astype method seems to have change, it no longer has the
copy keyword