DEV Community

Nilotpal Choudhury
Nilotpal Choudhury

Posted on

Answer: sum(-1) in np.array.sum(-1) mean? [duplicate]

According to numpy doc, It is sum along the axis=-1 which in python is last axis. In python indexing, -1 represents the last index. In your example, it is the sum of all elements along the 3rd axis, which results in a (10,10) shape. Here is a smaller example…

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more