read

astropy.io.ascii.read(table, guess=None, **kwargs)[source] [edit on github]

Read the input table and return the table. Most of the default behavior for various parameters is determined by the Reader class.

Parameters:

table : str, file-like, list, pathlib.Path object

Input table as a file name, file-like object, list of strings, single newline-separated string or pathlib.Path object .

guess : bool

Try to guess the table format (default= True)

format : str, BaseReader

Input table format

Inputter : BaseInputter

Inputter class

Outputter : BaseOutputter

Outputter class

delimiter : str

Column delimiter string

comment : str

Regular expression defining a comment line in table

quotechar : str

One-character string to quote fields containing special characters

header_start : int

Line index for the header line not counting comment or blank lines. A line with only whitespace is considered blank.

data_start : int

Line index for the start of data not counting comment or blank lines. A line with only whitespace is considered blank.

data_end : int

Line index for the end of data not counting comment or blank lines. This value can be negative to count from the end.

converters : dict

Dictionary of converters

data_Splitter : BaseSplitter

Splitter class to split data columns

header_Splitter : BaseSplitter

Splitter class to split header columns

names : list

List of names corresponding to each data column

include_names : list

List of names to include in output (default= None selects all names)

exclude_names : list

List of names to exclude from output (applied after include_names)

fill_values : dict

specification of fill values for bad or missing table values

fill_include_names : list

List of names to include in fill_values (default= None selects all names)

fill_exclude_names : list

List of names to exclude from fill_values (applied after fill_include_names)

fast_reader : bool

Whether to use the C engine, can also be a dict with options which default to False (default= True)

Reader : BaseReader

Reader class (DEPRECATED) (default= Basic).

Returns:

dat : Table

Output table