dcase_util.containers.MetaDataContainer.load
- MetaDataContainer.load(filename=None, fields=None, csv_header=True, file_format=None, delimiter=None, decimal='point')[source]
Load event list from delimited text file (csv-formatted)
Preferred delimiter is tab, however, other delimiters are supported automatically (they are sniffed automatically).
- Supported input formats:
[file(string)]
[file(string)][scene_label(string)]
[file(string)][scene_label(string)][identifier(string)]
[event_onset (float)][tab][event_offset (float)]
[event_onset (float)][tab][event_offset (float)][tab][event_label (string)]
[file(string)][tab][onset (float)][tab][offset (float)][tab][event_label (string)]
[file(string)[tab][scene_label(string)][tab][onset (float)][tab][offset (float)]
[file(string)[tab][scene_label(string)][tab][onset (float)][tab][offset (float)][tab][event_label (string)]
[file(string)[tab][scene_label(string)][tab][onset (float)][tab][offset (float)][tab][event_label (string)][tab][source(single character)]
[file(string)[tab][scene_label(string)][tab][onset (float)][tab][offset (float)][tab][event_label (string)][tab][source(string)]
[file(string)[tab][tags (list of strings, delimited with ;)]
[file(string)[tab][scene_label(string)][tab][tags (list of strings, delimited with ;)]
[file(string)[tab][scene_label(string)][tab][tags (list of strings, delimited with ;)][tab][event_onset (float)][tab][event_offset (float)]
- Parameters
- filenamestr
Path to the meta data in text format (csv). If none given, one given for class constructor is used. Default value None
- fieldslist of str, optional
List of column names. Used only for CSV formatted files. Default value None
- csv_headerbool, optional
Read field names from first line (header). Used only for CSV formatted files. Default value True
- file_formatFileFormat, optional
Forced file format, use this when there is a miss-match between file extension and file format. Default value None
- delimiterstr, optional
Forced data delimiter for csv format. If None given, automatic delimiter sniffer used. Use this when sniffer does not work. Default value None
- decimalstr
Decimal ‘point’ or ‘comma’ Default value ‘point’
- Returns
- datalist of event dicts
List containing event dicts