Use `asarray` instead of `frombuffer`.

`frombuffer` didn't work with memoryviews and was unnecessary anyway.