Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to build a shape Matrix with Numpy

Shulou Source: shulou.com Published: 2022-06-01 07:53:18 11月15日 Update

This article introduces the knowledge of "how to build a shape matrix with Numpy". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Construct a matrix whose shape is (6, 7, 8), and find the index value of the 100th element.

Import numpy as np

Z = np.unravel_index (100,6 and 7) print (z)

Print the results:

(1, 5, 4) this is the end of "how to build a shape Matrix with Numpy". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Matrix content more knowledge practical successful next elements dilemmas facts situations articles cases indexes results ribbons websites industries processes high quality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Shulou Technology Xiaomi Microsoft