ceumicrodata / respect-trade-similarity

Trade Similarity Index for RESPECT project
MIT License
2 stars 2 forks source link

Create publishable data #13

Open korenmiklos opened 5 years ago

korenmiklos commented 5 years ago

Clean .csv files with good variable names. exporter, importer, year, kullback_leibler_divergence, trade_similarity_index. Maybe separate fields for 4- and 6-digit calculations. Keep this as a bead, saving code, too. Short clean README.

korenmiklos commented 5 years ago

Sample below

declarant,partner,flow,year,kullback_leibler_divergence,trade_similarity_index
DE,RU,export,2014,0.632,0.924,
korenmiklos commented 5 years ago
THETA = 8.0
df['trade_similarity_index'] = pd.np.exp(-1/THETA * data['kullback_leibler_divergence'])