“Как объединить два массива” Ответ

Numpy Merge Marrys

>>> a = np.array([[1, 2], [3, 4]])
>>> b = np.array([[5, 6]])
>>> np.concatenate((a, b), axis=0)
array([[1, 2],
       [3, 4],
       [5, 6]])
>>> np.concatenate((a, b.T), axis=1)
array([[1, 2, 5],
       [3, 4, 6]])
Joyous Jay

Объедините два массива JavaScript

let arr1 = [0, 1, 2];
let arr2 = [3, 5, 7];
let primes = arr1.concat(arr2);

// > [0, 1, 2, 3, 5, 7]
Arab Fire Shaman

Как объединить два массива

    public static void main(String[] args) {

        int[] x = {1, 2, 3};
        int[] y = {4, 5, 6};
        int[] merge = new int[x.length + y.length];

        for (int i = 0; i < x.length; i++) {
            merge[i] += x[i];
        }

        for (int i = 0; i < y.length; i++) {
            merge[x.length + i] += y[i];
        }

        System.out.println(Arrays.toString(merge));
    }
Chathumal Sangeeth

Объединить два массива


$users = User::all();
$associates = Associate::all();
$userAndAssociate = $users->concat($associates);
Irfan

Объединить два массива

$users = User::all();
$associates = Associate::all();
$userAndAssociate = $users->concat($associates);
Irfan

Ответы похожие на “Как объединить два массива”

Вопросы похожие на “Как объединить два массива”

Больше похожих ответов на “Как объединить два массива” по Java

Смотреть популярные ответы по языку

Смотреть другие языки программирования