hi everybody..... i'm using an array to make a program but i'm not able to find the size (length) of the array.can anyone tell me how to do this?

Recommended Answers

All 2 Replies

If you mean an array in the numpy sense. e.g., z = numpy.zeros([5,3],float) then the shape attribute is what you want, e.g. z.shape returns (5,3).

If you're implementing an array as a Python list, then len(z) is what you want.

commented: nice help +7

thanks you very much.its what i wanted.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.