Apply the same transformation to all edge weights

Dear Thiago,

I am running the nested stochastic block model on a undirected graph containing a single vertex property (which represent the gene name) and 4 different edge properties, that ranges between -1 and 1. I would like to apply a transformation on the edge weights in order to use the "real-normal" edge covariate type. The transformation should be y=arctan(x) (as you suggested here).

Is there a way to apply such transformation to all edge properties?
Thanks for help,

Giorgia

If w is your edge property map, you can do simply:

w.fa = numpy.arctan(w.fa)

See the documentation on property maps: Quick start guide — graph-tool 2.92 documentation

In the end I did it in this way:

    eprops = list(g.ep)
    if metric=="rho":
        for ep in eprops:
            g.ep[ep].t(np.arctan,inplace=True)

and it worked.