Math and array tools#

Quiz: how do you return the indices of a vector v = np.random.rand(100) that are greater than 0.4 but less than 0.6? If you answered ((v>0.4)*(v<0.6)).nonzero()[0], you’re right! But with Sciris, you can also just do sc.findinds(v>0.4, v<0.6), which is a little easier.

sciris.sc_math

Extensions to Numpy, including finding array elements and smoothing data.

sciris.sc_asd

Adaptive stochastic descent optimization algorithm, building on scipy.optimize.