Calculates Economic Complexity Indexes
Project description
econci
Calculates Economic Complexity Indexes
Free software: MIT license
This package implements the indexes found in the Atlas of Economic Complexity [HaRH2014]. It also creates the Product Space.
Installation
pip install econci
Usage
import econci
comp = econci.Complexity(df, c='country', p='product', values='export')
comp.calculate_indexes()
eci = comp.eci
pci = comp.pci
# creating the product space
comp.create_product_space()
# the graphs are networkx.Graph objects
complete_graph = comp.complete_graph # complete product space
max_spanning_tree = comp.maxst # maximum spanning tree
prod_space = comp.product_space # product space
# edges_nodes_to_csv saves one csv file with edges and weights
# and another file with nodes information
econci.edges_nodes_to_csv(prod_space, graph_name='prod_space', dir_path='./data/')
Complete list of calculated indexes:
Economic Complexity Index:
comp.eci
Product Complexity Index:
comp.pci
Country Diversity:
comp.diversity
Product Ubiquity:
comp.ubiquity
Balassa’s RCA:
comp.rca
Proximity:
comp.proximity
Density:
comp.density
Distance:
comp.distance
You can also vary the threshold of RCA value when creating the Mcp matrix.
The Complexity
class accepts the parameter m_cp_thresh
, which by default is 1.0
.
comp.create_product_space()
also accepts the argument edge_weight_thresh
, by default 0.65
.
This argument filters edges to be added to the maximum spanning tree by weight.
References
Hausmann, R., Hidalgo, C. A., Bustos, S., Coscia, M., Chung, S., Jimenez, J., … Yildirim, M. A. (2014). The Atlas of Economic Complexity: Mapping Paths to Prosperity. MIT Press.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2020-06-06)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for econci-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c44f3f423d2dd10e8ef2674e1af80235c009989181e20b875f3b53d4e3b85ec8 |
|
MD5 | 9b8ae630fbe66795dc808dc6a4d3d815 |
|
BLAKE2b-256 | 4e49adb211cfebb19a07f7542ff5b3ffb5c63bddea53e3d9efdafba620461903 |