bundles / scipy latest / scipy / io / arff / _arffread / tokenize_attribute
function
scipy.io.arff._arffread:tokenize_attribute
source: /scipy/io/arff/_arffread.py :515
Signature
def tokenize_attribute ( iterable , attribute ) Summary
Parse a raw string in header (e.g., starts by @attribute).
Extended Summary
Given a raw string attribute, try to get the name and type of the attribute. Constraints:
The first line must start with @attribute (case insensitive, and space like characters before @attribute are allowed)
Works also if the attribute is spread on multilines.
Works if empty lines or comments are in between
Parameters
attribute: strthe attribute string.
Returns
name: strname of the attribute
value: strvalue of the attribute
next: strnext line to be parsed
Examples
If attribute is a string defined in python as r"floupi real", will return floupi as name, and real as value.from scipy.io.arff._arffread import tokenize_attribute iterable = iter([0] * 10) # dummy iterator✓
tokenize_attribute(iterable, r"@attribute floupi real")
✗tokenize_attribute(iterable, r" @attribute 'floupi 2' real ")
✗Aliases
-
scipy.io.arff._arffread.tokenize_attribute