Fix test in python 3.

This is related to the unpickle problem of ndarray.
Merge pull request #1752 from nouiz/py3

Fix test in python 3.