I have grandfathered a code which works has list:
A = [ 's1', 's2', 's3', 's1' ] #the actual size is about 200
B = [ 1, 2, 13, 4 ] #same size as A
s1, s2, s3 are variables defined on the fly as:
s1 = 5
s2 = 3
s3 = 13
I have a function defined as:
def fun1( s, arg2 ):
return s * numpy.random.normal( 0, 1, ( 200, arg2 ) )
arg2 in above function comes from array B corresponding to s1 selected
I want to generate C such that:
C = [ fun1(s1,1), fun1(s2,2), fun1(s3,13), fun1(s1,4) ] #C can be list or collection of arrays, not sure about the best data structure for C