watex.utils.funcutils.make_ids#
- watex.utils.funcutils.make_ids(arr, prefix=None, how='py', skip=False)[source]#
Generate auto Id according to the number of given sites.
- Parameters:
arr – Iterable object to generate an id site . For instance it can be the array-like or list of EDI object that composed a collection of watex.edi.Edi object.
prefix (str) – string value to add as prefix of given id. Prefix can be the site name.
how – Mode to index the station. Default is ‘Python indexing’ i.e. the counting starts by 0. Any other mode will start the counting by 1.
skip (bool) – skip the long formatage. the formatage acccording to the number of collected file.
- Returns:
ID number formated
- Return type:
list
- Example:
>>> import numpy as np >>> from watex.utils.func_utils import make_ids >>> values = ['edi1', 'edi2', 'edi3'] >>> make_ids (values, 'ix') ... ['ix0', 'ix1', 'ix2'] >>> data = np.random.randn(20) >>> make_ids (data, prefix ='line', how=None) ... ['line01','line02','line03', ... , line20] >>> make_ids (data, prefix ='line', how=None, skip =True) ... ['line1','line2','line3',..., line20]