cfunction from R.
Since this whole library is aimed at re-creating in Python what R has already done so well, the
cfunction was created to wrap
numpy.concatenateand mimic the R functionality. Similar to R, this works with scalars, iterables, and any mix therein.
Note that using the
cfunction on multi-nested lists or iterables will fail!
cwith varargs will yield a single array:
>>> c(1, 2, 3, 4) array([1, 2, 3, 4])
cwith nested lists and scalars will also yield a single array:
>>> c([1, 2], 4, c(5, 4)) array([1, 2, 4, 5, 4])
cwith multi-level lists will fail!
>>> c([1, 2, 3], [[1, 2]]) ValueError: all the input arrays must have same number of dimensions