Dear Liu, as per documentation, the second argument of random_graph takes a function, passing np.poisson(4) is like passing one single value form that distribution. Try changing your code to:
g = gt.random_graph(1000, deg_sampler=lambda:np.poisson(4), directed=False) and see if it works as intended. Best, Giuseppe 2014-04-17 15:30 GMT+02:00 Liu <[email protected]>: > Dear Tiago, > > I am trying to generate an Erdos-Renyi network like this: > > import graph_tool.all as gt > import numpy.random as np > > g = gt.random_graph(1000, deg_sampler=np.poisson(4), directed=False) > > but it doesn't work out. Is anything I misunderstood in the documentation? > I am new in this field. Thanks for your help! > > Best, > Liu > > _______________________________________________ > graph-tool mailing list > [email protected] > http://lists.skewed.de/mailman/listinfo/graph-tool > >
_______________________________________________ graph-tool mailing list [email protected] http://lists.skewed.de/mailman/listinfo/graph-tool
