crowsetta.example#
- crowsetta.example(name: str, return_path: bool = False)[source]#
Get an example annotation file.
Parameter#
- namestr
Human-readable name that refers to annotation file. For a list pf names, call
crowsetta.examples.show().- return_pathbool
If
True, return the path to the annotation file. Default isFalse. WhenFalse, an instance of the class that represents a set of annotations in the format used by the example is returned.
Examples
>>> marron1 = crowsetta.example("marron1") >>> print(marron1) AudSeq(start_times=array([ 0. , 0.76981817, 1.13127401, 2.21840074, 2.55502374, 3.09030949, 3.69457537, 3.81322118, 4.05603121, 4.86171904, 4.87551507, 5.52392822, 6.55587085, 6.59449972, 7.0883974 , 7.18772877, 7.23463526, 7.94375092, 9.01984083, 9.06950652, 9.18263392, 10.06282028, 10.07661631, 10.9705987 , 10.98715393, 11.80663778, 11.86458109, 12.19016727, 13.24142433, 13.277294 , 14.49686257, 14.60723076, 15.22805186, 15.31082801, 16.22136563, 17.25606747, 18.16660509, 18.20247475, 19.65381653, 19.75590711, 20.71059201, 20.78509054, 20.96719806, 21.02514137, 21.35624596, 21.45005892, 21.66527691, 21.67355452, 22.73860761, 22.82966137, 23.63534921, 24.59831172, 24.60383013, 24.67281025, 24.77214163, 25.68267925, 25.70751209, 26.65943778, 27.7410461 , 27.76036054, 28.34531198]), end_times=array([ 0.76981817, 1.13127401, 2.21840074, 2.55502374, 3.09030949, 3.69457537, 3.81322118, 4.05603121, 4.86171904, 4.87551507, 5.53496504, 6.55587085, 6.59449972, 7.0883974 , 7.18772877, 7.23463526, 7.94375092, 9.01984083, 9.06950652, 9.18263392, 10.06282028, 10.07661631, 10.9705987 , 10.98715393, 11.80663778, 11.86458109, 12.20396329, 13.24142433, 13.277294 , 14.49686257, 14.60723076, 15.22805186, 15.31082801, 16.22136563, 17.25606747, 18.16660509, 18.20247475, 19.65381653, 19.75590711, 20.71059201, 20.78509054, 20.96719806, 21.02514137, 21.35624596, 21.45005892, 21.66527691, 21.67355452, 22.73860761, 22.82966137, 23.63534921, 24.59831172, 24.60383013, 24.67281025, 24.77214163, 25.68267925, 25.70751209, 26.65943778, 27.7410461 , 27.76036054, 28.359108 , 29.10133412]), labels=<StringArray> [ 'SIL', 'call', 'SIL', 'call', 'SIL', 'Z', 'SIL', 'Ci', 'C', 'SIL', 'H', 'E', 'SIL', 'R', 'SIL', 'J1', 'J1', 'J2', 'J2', 'SIL', 'B1', 'SIL', 'B2', 'SIL', 'Q', 'SIL', 'H', 'E', 'SIL', 'R', 'SIL', 'O', 'SIL', 'J1', 'J2', 'L', 'SIL', 'N', 'SIL', 'A', 'SIL', 'O', 'SIL', 'P', 'SIL', 'K', 'SIL', 'V', 'SIL', 'J1', 'J2', 'SIL', 'J2', 'SIL', 'B1', 'SIL', 'B2', 'Q', 'SIL', 'H', 'E'] Length: 61, dtype: string, annot_path=PosixPath('/Users/davidnicholson/Documents/repos/vocalpy/crowsetta/src/crowsetta/examples/405_marron1_June_14_2016_69640887.audacity.txt'), notated_path=None) # noqa: E501
You can specify
return_path=Trueto get apathlib.Pathinstance that points to the file. This can be used with thefrom_filemethod of the format classes.>>> patg = crowsetta.example("marron1", return_path=True) >>> marron1 = crowsetta.AudSeq.from_file(path) >>> print(marron1) AudSeq(start_times=array([ 0. , 0.76981817, 1.13127401, 2.21840074, 2.55502374, 3.09030949, 3.69457537, 3.81322118, 4.05603121, 4.86171904, 4.87551507, 5.52392822, 6.55587085, 6.59449972, 7.0883974 , 7.18772877, 7.23463526, 7.94375092, 9.01984083, 9.06950652, 9.18263392, 10.06282028, 10.07661631, 10.9705987 , 10.98715393, 11.80663778, 11.86458109, 12.19016727, 13.24142433, 13.277294 , 14.49686257, 14.60723076, 15.22805186, 15.31082801, 16.22136563, 17.25606747, 18.16660509, 18.20247475, 19.65381653, 19.75590711, 20.71059201, 20.78509054, 20.96719806, 21.02514137, 21.35624596, 21.45005892, 21.66527691, 21.67355452, 22.73860761, 22.82966137, 23.63534921, 24.59831172, 24.60383013, 24.67281025, 24.77214163, 25.68267925, 25.70751209, 26.65943778, 27.7410461 , 27.76036054, 28.34531198]), end_times=array([ 0.76981817, 1.13127401, 2.21840074, 2.55502374, 3.09030949, 3.69457537, 3.81322118, 4.05603121, 4.86171904, 4.87551507, 5.53496504, 6.55587085, 6.59449972, 7.0883974 , 7.18772877, 7.23463526, 7.94375092, 9.01984083, 9.06950652, 9.18263392, 10.06282028, 10.07661631, 10.9705987 , 10.98715393, 11.80663778, 11.86458109, 12.20396329, 13.24142433, 13.277294 , 14.49686257, 14.60723076, 15.22805186, 15.31082801, 16.22136563, 17.25606747, 18.16660509, 18.20247475, 19.65381653, 19.75590711, 20.71059201, 20.78509054, 20.96719806, 21.02514137, 21.35624596, 21.45005892, 21.66527691, 21.67355452, 22.73860761, 22.82966137, 23.63534921, 24.59831172, 24.60383013, 24.67281025, 24.77214163, 25.68267925, 25.70751209, 26.65943778, 27.7410461 , 27.76036054, 28.359108 , 29.10133412]), labels=<StringArray> [ 'SIL', 'call', 'SIL', 'call', 'SIL', 'Z', 'SIL', 'Ci', 'C', 'SIL', 'H', 'E', 'SIL', 'R', 'SIL', 'J1', 'J1', 'J2', 'J2', 'SIL', 'B1', 'SIL', 'B2', 'SIL', 'Q', 'SIL', 'H', 'E', 'SIL', 'R', 'SIL', 'O', 'SIL', 'J1', 'J2', 'L', 'SIL', 'N', 'SIL', 'A', 'SIL', 'O', 'SIL', 'P', 'SIL', 'K', 'SIL', 'V', 'SIL', 'J1', 'J2', 'SIL', 'J2', 'SIL', 'B1', 'SIL', 'B2', 'Q', 'SIL', 'H', 'E'] Length: 61, dtype: string, annot_path=PosixPath('/Users/davidnicholson/Documents/repos/vocalpy/crowsetta/src/crowsetta/examples/405_marron1_June_14_2016_69640887.audacity.txt'), notated_path=None) # noqa: E501