table_to_ndarray: minor refactoring