#T=0.05 #R_star=3 # #data_list=get_data.list_of_static_networks()+get_data.list_of_temporal_networks() # #data=data_list[8] #R0=get_R0_prediction(data,R_star,T) # #print(R0) R_star_range=[2,3,4] # get list of networks temporal_networks=get_data.list_of_temporal_networks(bats=False) static_networks=get_data.list_of_static_networks() data_list=static_networks+temporal_networks phi_values=pk.load(open('pickles/phi.p','rb')) epsilon=pk.load(open('pickles/epsilon.p','rb')) for R_star in R_star_range: R0_het={} R0_hom={} for data in data_list: e=epsilon[data]
import get_data import pandas as pd import pickle import numpy as np mean_weight_values={} weight_heterogeneity_values={} data_list=get_data.list_of_static_networks()+get_data.list_of_temporal_networks(bats=True) for data in data_list: df,t_0,delta_t,species,interaction,phi_zero=get_data.dataframe(data) ############################################################ if data=='bats': ID_list=list(set(df['ID1'])) else: ID_list=list(set(pd.concat([df['ID1'],df['ID2']]))) N=len(ID_list) #################################################################### K=[len(set(pd.concat([df[df['ID1']==ID]['ID2'],df[df['ID2']==ID]['ID1']]))) for ID in ID_list] S=[len(pd.concat([df[df['ID1']==ID]['ID2'],df[df['ID2']==ID]['ID1']])) for ID in ID_list] W=[] edge_list=[] for i,row in df.iterrows(): edge=tuple(sorted([row['ID1'],row['ID2']])) if edge not in edge_list: edge_list.append(edge)
import get_data import heterogeneity_MSE as mse import pandas as pd import pickle phi_values = {} epsilon_values = {} fidelity_values = {} data_list = get_data.list_of_static_networks( ) + get_data.list_of_temporal_networks(bats=True) #+get_data.twitter() for data in data_list: df, t_0, delta_t, species, interaction, phi_zero = get_data.dataframe(data) ############################################################ if data == 'bats_0': ID_list = list(set(df['ID1'])) else: ID_list = list(set(pd.concat([df['ID1'], df['ID2']]))) N = len(ID_list) #################################################################### K = [ len( set( pd.concat( [df[df['ID1'] == ID]['ID2'], df[df['ID2'] == ID]['ID1']])))