readfile.dict
Creates a python dictionary from the information in the header and the data in the table. Makes use
of readfile.table
and readfile.header
.
> dic = readfile.dict(file, *optional_args)
file
type:
string
parameter:
Name of the file. File should be a table with objects of arbitrary
type (same per column). If cols
is specified, the file can have incomplete
columns (that are not included in the columns to be read).
cols
type:
int or list of ints
default:
'all'
parameter:
Column(s) to be returned. Numbering starts at 0
.
data_return_type
type:
string
default:
'numpy'
parameter:
Data type to be returned. Currently, 'numpy' is the only option,
which means that the array returned will be a numpy array.
data_types
type:
type or list of types
default:
float
parameter:
Type(s) of the column(s) to be returned. If a list is given, it
must be of the same length as cols
. If only one type is provided, all
columns will have the same type.
delimiter
type:
string
default:
''
parameter:
Delimiter between columns and column names in the header.
exclude
type:
string or list of strings, of any length
default:
'#'
parameter:
Characters with which all the lines to be excluded should start
with. Only lines that do not start with the string(s) given by exclude
will
be returned. If include
is set, exclude
is ignored.
include
type:
string or list of strings, of any length
default:
None
parameter:
Characters with which all the lines to be included should start
with. Only lines that start with the string(s) given by include
will be
returned. If include
is set, exclude
is ignored.
removechar
type:
string
default:
'#'
parameter:
Character to be removed from the beginning of the header, which
should be defined in the first line with column names separated by delimiter
.
This is useful because usually the header stars with a special character so that it is
not included in the table, but this character is not a column name.