Basically, why do these work:
class MyClass:
Dict={['A','B','C'][i]:{['a','b','c'][j]:[1,2,3][j] for j in range(3)} for i in range(3)}
and
class MyClass:
Table = ['A','B','C']
Dict={Table[0]:'a',Table[1]:'b',Table[2]:'c'}
but not this one?
class MyClass:
Table = ['A','B','C']
Dict={Table[i]:['a','b','c'][i] for i in range(3)}
I'm trying to consolidate a bunch of arrays, interpolation functions, and solvers by putting them all in classes. Each array contains a number of different properties so I figured the best way to sort this data was through nested dictionaries (Many of the tables aren't complete so I can't use numpy arrays or even lists very effectively because the indices change depending on the line of the data). I've worked out all the other kinks, but for some reason moving it into a class gives me an error:
NameError: name 'Table' is not defined
I'm an engineering student and basically only learned how to use scipy solvers and integrators; everything else is self taught. Don't be afraid to tell me I'm doing everything wrong :)