1. Learn
  2. /
  3. कोर्स
  4. /
  5. NumPy परिचय

Connected

अभ्यास

The fourth dimension

छोटे arrays जैसे sudoku_game_and_solution के लिए आउटपुट जाँचने का अच्छा तरीका उन्हें प्रिंट करना है, लेकिन बड़े और अधिक डाइमेंशन वाले arrays के साथ यह झंझट वाला हो जाता है. एक और अहम जाँच है array की .shape देखना.

अब, आप एक 4D array बनाएँगे जिसमें दो sudoku गेम और उनकी solutions होंगी. numpy को np के रूप में लोड किया गया है. पिछले उदाहरण में आपने जो 3D array game_and_solution बनाया था, वह उपलब्ध है, साथ ही new_sudoku_game और new_sudoku_solution भी.

निर्देश

100 XP
  • एक और 3D array new_game_and_solution नाम से बनाएँ, जिसमें अलग 2D गेम और 2D solution की जोड़ी हो: new_sudoku_game और new_sudoku_solution. new_sudoku_game पहले आना चाहिए और उसके बाद new_sudoku_solution.
  • एक 4D array games_and_solutions नाम से बनाएँ, जिसे इन दो 3D arrays से बनाएँ: game_and_solution और new_game_and_solution, इसी क्रम में.
  • games_and_solutions की shape प्रिंट करें.