fix get_ndarray for numpy numbers in python3