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)