Points.append

Points.append(toAppend, *, useLog=None)

Append points to this object.

Expand this object by appending the points of toAppend to the end of the object. The features in toAppend do not need to be in the same order as in the calling object; the data will automatically be placed using the calling object’s feature order if there is an unambiguous mapping. toAppend will be unaffected by calling this method.

Parameters:
  • toAppend (nimble Base object) – The nimble Base object whose contents we will be including in this object. Must have the same number of features as the calling object, but not necessarily in the same order. Must not share any point names with the calling object.

  • 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

insert, Base.merge

Examples

Append data; default names.

>>> X = nimble.zeros(2, 3)
>>> toAppend = nimble.ones(2, 3)
>>> X.points.append(toAppend)
>>> X
<Matrix 4pt x 3ft
     0  1  2
   ┌────────
 0 │ 0  0  0
 1 │ 0  0  0
 2 │ 1  1  1
 3 │ 1  1  1
>

Append mixed object types.

>>> lstData = [[1, 1, 1], [2, 2, 2]]
>>> X = nimble.data(lstData, pointNames=['1', '2'])
>>> lstAppend = [[3, 3, 3], [4, 4, 4]]
>>> toAppend = nimble.data(lstAppend,
...                        pointNames=['3', '4'])
>>> X.points.append(toAppend)
>>> X
<Matrix 4pt x 3ft
     0  1  2
   ┌────────
 1 │ 1  1  1
 2 │ 2  2  2
 3 │ 3  3  3
 4 │ 4  4  4
>

Reorder names.

>>> lstData = [[1, 2, 3], [1, 2, 3]]
>>> X = nimble.data(lstData, featureNames=['a', 'b', 'c'])
>>> lstAppend = [[3, 2, 1], [3, 2, 1]]
>>> toAppend = nimble.data(lstAppend,
...                        featureNames=['c', 'b', 'a'])
>>> X.points.append(toAppend)
>>> X
<Matrix 4pt x 3ft
     a  b  c
   ┌────────
 0 │ 1  2  3
 1 │ 1  2  3
 2 │ 1  2  3
 3 │ 1  2  3
>

Keywords: affix, adjoin, concatenate, concat, vstack, add, attach, join, merge