BaşlayınÜcretsiz Başlayın

3D array creation

In the first lesson, you created a sudoku_game two-dimensional NumPy array. Perhaps you have hundreds of sudoku game arrays, and you'd like to save the solution for this one, sudoku_solution, as part of the same array as its corresponding game in order to organize your sudoku data better. You could accomplish this by stacking the two 2D arrays on top of each other to create a 3D array.

numpy is loaded as np, and the sudoku_game and sudoku_solution arrays are available.

Bu egzersiz

Introduction to NumPy

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Create a 3D array called game_and_solution by stacking the two 2D arrays, sudoku_game and sudoku_solution, on top of one another; in the final array, sudoku_game should appear before sudoku_solution.
  • Print game_and_solution.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Create the game_and_solution 3D array
game_and_solution = ____

# Print game_and_solution
print(____) 
Kodu Düzenle ve Çalıştır