
Iordan G. answered 05/07/24
Machine learning researcher and data scientist using Python
Try something like this:
You can also do it with list comprehension:
Hope this helps, and I'll leave the test program up to you.
Richard P.
asked 05/07/24Write a function that returns the sum of all the elements in a specified column in a matrix using the following header:
def sumColumn(m, columnIndex):
Write a test program that reads a 3 × 4 matrix and displays the sum of each column. Note that the matrix is entered by rows and the numbers in each row are separated by a space in one line.
Iordan G. answered 05/07/24
Machine learning researcher and data scientist using Python
Try something like this:
You can also do it with list comprehension:
Hope this helps, and I'll leave the test program up to you.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.