.. _sphx_glr_auto_examples_utils_example_array_concatenation.py:
===================
Array concatenation
===================
In this example, we demonstrate pyramid's convenient ``c`` function, which is,
in essence, the same as R's. It's nothing more than a convenience function in
the package, but one you should understand if you're contributing.
.. raw:: html
.. code-block:: python
print(__doc__)
# Author: Taylor Smith
import pmdarima as pm
import numpy as np
# #############################################################################
# You can use the 'c' function to define an array from *args
array1 = pm.c(1, 2, 3, 4, 5)
# Or you can define an array from an existing iterable:
array2 = pm.c([1, 2, 3, 4, 5])
assert np.array_equal(array1, array2)
# You can even use 'c' to flatten arrays:
array_flat = pm.c(1, 2, 3, [4, 5])
assert np.array_equal(array_flat, np.arange(5) + 1)
**Total running time of the script:** ( 0 minutes 0.000 seconds)
.. only :: html
.. container:: sphx-glr-footer
.. container:: sphx-glr-download
:download:`Download Python source code: example_array_concatenation.py `
.. container:: sphx-glr-download
:download:`Download Jupyter notebook: example_array_concatenation.ipynb `
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery `_