Reputation: 397
Does anyone know how to create an array of lists in python?
For example, if I want the final structure to contain data where the 1st dimension is fixed but the 2nd dimension varies:
index 0: [5, 4, 3, 2, 1]
index 1: [6, 5, 4, 3, 2, 1]
index 2: [4, 3, 2, 1]
Upvotes: 2
Views: 11359
Reputation: 3054
It's just called a list of lists
x=[[5, 4, 3, 2, 1],[6, 5, 4, 3, 2, 1],[4, 3, 2, 1]]
Upvotes: 3