Previous topic


Next topic


This Page


NepidemiXConfigParser.parseRange(rstring, dtype=<type 'str'>)

Create a range of values from a string.

Utility method.

The valid formats of the string are
  • A single value.
  • A comma separated list of values
  • The form <first>:<step>:<last>

The function create an array containing the values, and also generate the range in the last case.

Parameters :

rstring : str

A string on the form: <value>, or <value>, <value>, <value>, ..., <value>, or <number>:<number>:<number>

dtype : special, optional

Datatype used for the numpy array. Default: str.

Returns :

retval : numpy.array

The method returns a numpy array contining the values in the string either the single value, the list of values, or the range from first (inclusive) to last (exclusive) by the step step.