Points.setNames

Points.setNames(assignments, oldIdentifiers=None, *, useLog=None)

Set or rename all of the point names of this object.

Set the point names of this object according to the values specified by the assignments parameter. If the number of new point names being passed as assignments is less than the number of points in the object, then the oldIdentifiers argument must be passed with the corresponding previous point names that are to be changed. If assignments is None, then all point names will be given new default values.

Parameters:
  • assignments (str, iterable, dict, None) –

    • str - A string not currently in the pointName set.

    • iterable - Given a list-like container, the mapping between names and array indices will be used to define the point names.

    • dict - The mapping for each point name in the format {name:index}

    • None - remove names from this object.

  • oldIdentifiers (str, int, iterable, None) –

    • str - The name of a point to be renamed.

    • int - The index of a point to be renamed

    • iterable - The names or indices of points to be renamed.

    • None - The default when assigning names to all points in the data.

  • useLog (bool, None) – Local control for whether to send object creation to the logger. If None (default), use the value as specified in the “logger” “enabledByDefault” configuration option. If True, send to the logger regardless of the global option. If False, do NOT send to the logger, regardless of the global option.

See also

getName, getNames

Examples

>>> X = nimble.identity(4, pointNames=['a', 'b', 'c', 'd'])
>>> X.points.setNames(['1', '2', '3', '4'])
>>> X.points.getNames()
['1', '2', '3', '4']
>>> X.points.setNames(['newer', 'sea'], oldIdentifiers=['1', '3'])
>>> X.points.getNames()
['newer', '2', 'sea', '4']
>>> X.points.setNames('by', oldIdentifiers='2')
>>> X.points.getNames()
['newer', 'by', 'sea', '4']

Keywords: rows, keys, indexes, indices, headers, headings, identifiers