def object_as_axis(arr, dtype, axis=-1):
    """
    cast an array of void objects to a typed axis

    Parameters
    ----------
    arr : ndarray, [ndim], void
        array of type np.void
    dtype : numpy dtype object
        the output dtype to cast the input array to
    axis : int
        position to insert the newly formed axis into

    Returns
    -------
    ndarray, [ndim+1], dtype
        output array cast to given dtype
    """
    # view the void objects as typed elements
    arr = arr.view(dtype).reshape(arr.shape + (-1,))
    # put the axis in the specified location
    return np.rollaxis(arr, -1, axis)