df_to_array

df_to_array(df, netshape, nettype, start_at='min')[source]

Returns a numpy array (snapshot representation) from thedataframe contact list

Parameters:
  • df – pandas df pandas df with columns, i,j,t.
  • netshape – tuple network shape, format: (node, time)
  • nettype – str ‘wu’, ‘wd’, ‘bu’, ‘bd’
  • start_at – str ‘min’ or ‘zero’ or int. If min, the 0th time-point in the array is min t value. If zero, the 0th time-point in the array is 0. If int, the 0th time-point in array starts at int in df.
tnet : array
(node,node,time) array for the network