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)

Feature flag article image

Create a feature flag in your IDE in 5 minutes with LaunchDarkly’s MCP server 🏁

How to create, evaluate, and modify flags from within your IDE or AI client using natural language with LaunchDarkly's new MCP server. Follow along with this tutorial for step by step instructions.

Read full post

👋 Kindness is contagious

Explore this practical breakdown on DEV’s open platform, where developers from every background come together to push boundaries. No matter your experience, your viewpoint enriches the conversation.

Dropping a simple “thank you” or question in the comments goes a long way in supporting authors—your feedback helps ideas evolve.

At DEV, shared discovery drives progress and builds lasting bonds. If this post resonated, a quick nod of appreciation can make all the difference.

Okay