Sep-13-2019, 04:31 PM
Can someone tell me how to sum values across lists of lists....For example I have a list of a list that is 2x4....It in turn is contained in a list that is 5 long so effectively a 2x4x5...I would like to grab the x element in each list from the whole 2x4x5...looking for the solution OTHER than numpy....Thank you...Here is the code for matrix list
Thank you!
Thank you!
#!/usr/bin/env python3 2 import random 3 def main(): 4 d = [] 5 for j in range(5): 6 d.append([[random.randint(0,4) for i in range(4)] for k in range(2)]) 7 return(d)