Package to calculate economic complexity and associated variables
Project description
# Economic Complexity and Product Complexity
Python package to calculate economic complexity indices.
STATA implementation of the economic complexity index available at: https://github.com/cid-harvard/ecomplexity
Explore complexity and associated data using Harvard CID's Atlas tool: http://atlas.cid.harvard.edu
### Tutorial
**Installation**:
At terminal: `pip install git+https://github.com/cid-harvard/py-ecomplexity@master`
**Usage**:
```python
from ecomplexity import ecomplexity
from ecomplexity import proximity
# Import trade data from CID Atlas
data_url = "https://intl-atlas-downloads.s3.amazonaws.com/country_hsproduct2digit_year.csv.zip"
data = pd.read_csv(data_url, compression="zip", low_memory=False)
data = data[['year','location_code','hs_product_code','export_value']]
# Calculate complexity
trade_cols = {'time':'year', 'loc':'location_code', 'prod':'hs_product_code', 'val':'export_value'}
cdata = ecomplexity(data, trade_cols)
# Calculate proximity matrix
prox_df = proximity(data, trade_cols)
```
### TODO:
- There are very minor differences in the values of density, COI and COG between STATA and Python due to the way matrix computations are handled by the two. These should be aligned in the future.
- knn options for density: in the future, allow knn parameter for density calculation
### References:
- Hausmann, R., Hidalgo, C. A., Bustos, S., Coscia, M., Simoes, A., & Yıldırım, M. (2013). The Atlas of Economic Complexity: Mapping Paths to Prosperity (Part 1). Retrieved from https://growthlab.cid.harvard.edu/files/growthlab/files/atlas_2013_part1.pdf
- Hidalgo, C. A., Klinger, B., Barabasi, A.-L., & Hausmann, R. (2007). The Product Space Conditions the Development of Nations. Science, 317(5837), 482–487. http://doi.org/10.1126/science.1144581
Python package to calculate economic complexity indices.
STATA implementation of the economic complexity index available at: https://github.com/cid-harvard/ecomplexity
Explore complexity and associated data using Harvard CID's Atlas tool: http://atlas.cid.harvard.edu
### Tutorial
**Installation**:
At terminal: `pip install git+https://github.com/cid-harvard/py-ecomplexity@master`
**Usage**:
```python
from ecomplexity import ecomplexity
from ecomplexity import proximity
# Import trade data from CID Atlas
data_url = "https://intl-atlas-downloads.s3.amazonaws.com/country_hsproduct2digit_year.csv.zip"
data = pd.read_csv(data_url, compression="zip", low_memory=False)
data = data[['year','location_code','hs_product_code','export_value']]
# Calculate complexity
trade_cols = {'time':'year', 'loc':'location_code', 'prod':'hs_product_code', 'val':'export_value'}
cdata = ecomplexity(data, trade_cols)
# Calculate proximity matrix
prox_df = proximity(data, trade_cols)
```
### TODO:
- There are very minor differences in the values of density, COI and COG between STATA and Python due to the way matrix computations are handled by the two. These should be aligned in the future.
- knn options for density: in the future, allow knn parameter for density calculation
### References:
- Hausmann, R., Hidalgo, C. A., Bustos, S., Coscia, M., Simoes, A., & Yıldırım, M. (2013). The Atlas of Economic Complexity: Mapping Paths to Prosperity (Part 1). Retrieved from https://growthlab.cid.harvard.edu/files/growthlab/files/atlas_2013_part1.pdf
- Hidalgo, C. A., Klinger, B., Barabasi, A.-L., & Hausmann, R. (2007). The Product Space Conditions the Development of Nations. Science, 317(5837), 482–487. http://doi.org/10.1126/science.1144581
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ecomplexity-0.3.tar.gz
(7.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ecomplexity-0.3-py3-none-any.whl
(10.8 kB
view details)
File details
Details for the file ecomplexity-0.3.tar.gz.
File metadata
- Download URL: ecomplexity-0.3.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d7368fa5b48d55ce1b6e81210e08132cb7f5294fa2ce471297d5a4c02996ac8
|
|
| MD5 |
98d91ea4a445c1fb2e164659f9d5e502
|
|
| BLAKE2b-256 |
a9a3a46cf99485f5a6a0af830130add9fa8761b51bef013303586bbdb7d65294
|
File details
Details for the file ecomplexity-0.3-py3-none-any.whl.
File metadata
- Download URL: ecomplexity-0.3-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cb2f6fdfb12f9205065a61115f9ba5c14c90f9c31797548c2ef7717eb6b58f6
|
|
| MD5 |
6ae6e1190ae24942e940e67f0fc39eec
|
|
| BLAKE2b-256 |
886eaf0267072976ff505bd727761dae33ee57c45fa84cfa42c26dd307f7f5eb
|