ECSVEnginePandas#

class astropy.io.misc.ecsv.ECSVEnginePandas[source]#

Bases: ECSVEngine

ECSV reader engine using pandas.

Attributes Summary

Methods Summary

convert_np_type(np_type)

Convert a numpy type string to engine-specific type for parsing.

get_data_kwargs(header, null_values)

Generate a dictionary of keyword arguments for data parsing.

Attributes Documentation

format = 'pandas.csv'#
name = 'pandas'#

Methods Documentation

convert_np_type(np_type)[source]#

Convert a numpy type string to engine-specific type for parsing.

For instance, for pandas the "int32" numpy type gets converted to an Int32Dtype() instance to read columns as a nullable int32.

Parameters:
np_typestr

The numpy type string to be converted.

Returns:
Any

Corresponding engine-specific type.

get_data_kwargs(header, null_values)[source]#

Generate a dictionary of keyword arguments for data parsing.

This accounts for the API variations in each engine CSV reader.

Parameters:
headerECSVHeader

ECSVHeader object within header information.

null_valueslist of str

List of strings with values to be interpreted as null or missing data.

Returns:
dict[str, Any]

Dict of keyword arguments to be passed to engine CSV reader.