econml/utilities.py
def stack(XS, axis=0):
    """
    Join a sequence of arrays along a new axis.

    The axis parameter specifies the index of the new axis in the dimensions of the result.
    For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension.

    Parameters
    ----------
    arrays : sequence of array_like
        Each array must have the same shape

    axis : int, optional
        The axis in the result array along which the input arrays are stacked

    Returns
    -------
    ndarray or SparseArray
        The stacked array, which has one more dimension than the input arrays.
        It will be sparse if the inputs are.
    """
    def st(*XS):
        return sp.stack(XS, axis=axis) if iscoo(XS[0]) else np.stack(XS, axis=axis)
    return _apply(st, *XS)

    Join a sequence of arrays along a new axis.

    The axis parameter specifies the index of the new axis in the dimensions of the result.
    For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension.

    Parameters
    ----------
    arrays : sequence of array_like
        Each array must have the same shape

    axis : int, optional
        The axis in the result array along which the input arrays are stacked

    Returns
    -------
    ndarray or SparseArray
        The stacked array, which has one more dimension than the input arrays.
        It will be sparse if the inputs are.
    
Join a sequence of arrays along a new axis.
The axis parameter specifies the index of the new axis in the dimensions of the result.
For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension.

Parameters

arrays : sequence of array_like
Each array must have the same shape

axis : int, optional
The axis in the result array along which the input arrays are stacked

Returns

ndarray or SparseArray
The stacked array, which has one more dimension than the input arrays.
It will be sparse if the inputs are.
Join a sequence of arrays along a new axis . The axis parameter specifies the index of the new axis in the dimensions of the result . For example if axis = 0 it will be the first dimension and if axis = - 1 it will be the last dimension . Parameters arrays : sequence of array_like Each array must have the same shape axis : int optional The axis in the result array along which the input arrays are stacked Returns ndarray or SparseArray The stacked array which has one more dimension than the input arrays . It will be sparse if the inputs are .
def stack(XS, axis=0):
    def st(*XS):
        return sp.stack(XS, axis=axis) if iscoo(XS[0]) else np.stack(XS, axis=axis)
    return _apply(st, *XS)
def stack ( XS , axis = 0 ) : def st ( * XS ) : return sp . stack ( XS , axis = axis ) if iscoo ( XS [ 0 ] ) else np . stack ( XS , axis = axis ) return _apply ( st , * XS )
Join a sequence of arrays along a new axis.
Join a sequence of arrays along a new axis .
"""
    Join a sequence of arrays along a new axis.

    The axis parameter specifies the index of the new axis in the dimensions of the result.
    For example, if axis=0 it will be the first dimension and if axis=-1 it will be the last dimension.

    Parameters
    ----------
    arrays : sequence of array_like
        Each array must have the same shape

    axis : int, optional
        The axis in the result array along which the input arrays are stacked

    Returns
    -------
    ndarray or SparseArray
        The stacked array, which has one more dimension than the input arrays.
        It will be sparse if the inputs are.
    """
XS
axis