convert_numpy¶
-
astropy.io.ascii.convert_numpy(numpy_type)[source]¶ Return a tuple containing a function which converts a list into a numpy array and the type produced by the converter function.
- Parameters
- numpy_typenumpy data-type
The numpy type required of an array returned by
converter. Must be a valid numpy type (e.g., numpy.uint, numpy.int8, numpy.int64, numpy.float64) or a python type covered by a numpy type (e.g., int, float, str, bool).
- Returns
- (converter, converter_type)(function, generic data-type)
converteris a function which accepts a list and converts it to a numpy array of typenumpy_type.converter_typetracks the generic data type produced by the converter function.
- Raises
- ValueError
Raised by
converterif the list elements could not be converted to the required type.