def read_csv(csv_name):
data = {}<EOL>if not isinstance(csv_name, (str, unicode)):<EOL><INDENT>raise exceptions.InvalidDataFormat('<STR_LIT>')<EOL><DEDENT>with open(csv_name, '<STR_LIT:r>') as csv_data:<EOL><INDENT>reader = csv.reader(csv_data, delimiter='<STR_LIT:U+002C>', quotechar='<STR_LIT:|>')<EOL>for row in reader:<EOL><INDENT>try:<EOL><INDENT>key = to_epoch(row[<NUM_LIT:0>])<EOL>value = float(row[<NUM_LIT:1>])<EOL>data[key] = value<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>return data<EOL>
Read data from a csv file into a dictionary.
:param str csv_name: path to a csv file.
:return dict: a dictionary represents the data in file.