Features.append

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

Append features to this object.

Expand this object by appending the features of toAppend to the end of this object. The points 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 point 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 point names as the calling object, but not necessarily in the same order. Must not share any feature 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(3, 2)
>>> toAppend = nimble.ones(3, 2)
>>> X.features.append(toAppend)
>>> X
<Matrix 3pt x 4ft
     0  1  2  3
   ┌───────────
 0 │ 0  0  1  1
 1 │ 0  0  1  1
 2 │ 0  0  1  1
>

Append mixed object types.

>>> lstData = [[1, 2], [5, 6]]
>>> X = nimble.data(lstData, featureNames=['1', '2'])
>>> lstAppend = [[3, 4], [7, 8]]
>>> toAppend = nimble.data(lstAppend,
...                        featureNames=['3', '4'])
>>> X.features.append(toAppend)
>>> X
<Matrix 2pt x 4ft
     1  2  3  4
   ┌───────────
 0 │ 1  2  3  4
 1 │ 5  6  7  8
>

Reorder names.

>>> lstData = [[1, 2], [5, 6]]
>>> X = nimble.data(lstData, pointNames=['a', 'b'])
>>> lstAppend = [[7, 8], [3, 4]]
>>> toAppend = nimble.data(lstAppend,
...                        pointNames=['b', 'a'])
>>> X.features.append(toAppend)
>>> X
<Matrix 2pt x 4ft
     0  1  2  3
   ┌───────────
 a │ 1  2  3  4
 b │ 5  6  7  8
>

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