\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
csv.get_header¶
View page sourceGet the Header from a CSV File¶
Prototype¶
# at_cascade.csv.get_header
def get_header(file_name) :
assert type(file_name) == str
# ...
assert type(header) == list
return header
file_name¶
is a str with the name of the CSV file.
The first line of the file is the header line and the others contain
the data.
The header value in the j-th column of the first line is the
corresponding column name.
header¶
the return value header is a list of str.
We use n to denote the length of the list which is
the number of commas in the first line plus one.
For j, an int , between zero and n -1,
the name of the j-th column is header [ j ].