I have a question, as I perform mathematical operations with an array of lists such as I get the sum of each array list getting a new list with the Valar for the sum of each list in the array.
thanks for any response
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What I understand is that you have a list of list — in effect, matrix. You want the sum of each row. I agree with other answerers that you should use numpy.
we can create a mulidimensional array:
Now we can use
a.sum([dimension])wheredimensionis how you want to sum the array. Summing each row is dimension 1:You can also sum each column:
And sum all: