All Projects → cid-harvard → py-ecomplexity

cid-harvard / py-ecomplexity

Licence: MIT license
Python package to compute economic complexity and associated variables

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to py-ecomplexity

acclimate
Acclimate - an agent-based model for economic loss propagation
Stars: ✭ 17 (-63.04%)
Mutual labels:  economics, international-trade
edgar-crawler
Download financial reports from SEC's EDGAR. Extract clean textual data from specific item sections and bootstrap your financial NLP research. Software from the research paper published in ECONLP 2021.
Stars: ✭ 71 (+54.35%)
Mutual labels:  economics
abcFinance
Agent-based computational Finance
Stars: ✭ 27 (-41.3%)
Mutual labels:  economics
nft-swap-sdk
Ethereum's missing p2p NFT and token swap library for web3 developers. Written in TypeScript. Powered by 0x.
Stars: ✭ 200 (+334.78%)
Mutual labels:  trade
lecture-python.myst
Quantitative Economics with Python
Stars: ✭ 49 (+6.52%)
Mutual labels:  economics
adamant-tradebot
Free market-making software for cryptocurrency projects and exchanges. Makes trade volume, maintains spread and liquidity/depth, set price range, and builds live-like dynamic order book.
Stars: ✭ 113 (+145.65%)
Mutual labels:  trade
LiuAlgoTrader
Framework for algorithmic trading
Stars: ✭ 514 (+1017.39%)
Mutual labels:  trade
js-data-structures
🌿 Data structures for JavaScript
Stars: ✭ 56 (+21.74%)
Mutual labels:  networks
PyNets
A Reproducible Workflow for Structural and Functional Connectome Ensemble Learning
Stars: ✭ 114 (+147.83%)
Mutual labels:  networks
bitmex-backtest-python
bitmex-backtest is a python library for backtest with bitmex fx trade rest api on Python 3.7 and above.
Stars: ✭ 13 (-71.74%)
Mutual labels:  trade
housing-model
Agent-based model of the UK housing market.
Stars: ✭ 29 (-36.96%)
Mutual labels:  economics
java-binance-api
Java Binance API Client
Stars: ✭ 72 (+56.52%)
Mutual labels:  trade
wikirepo
Python based Wikidata framework for easy dataframe extraction
Stars: ✭ 33 (-28.26%)
Mutual labels:  economics
inquisitor
Python Interface to econdb.com API
Stars: ✭ 31 (-32.61%)
Mutual labels:  economics
RogueAP-Detector
Rogue Access Point Detector
Stars: ✭ 28 (-39.13%)
Mutual labels:  networks
Microeconometrics.jl
Microeconometric estimation in Julia
Stars: ✭ 30 (-34.78%)
Mutual labels:  economics
how attentive are gats
Code for the paper "How Attentive are Graph Attention Networks?" (ICLR'2022)
Stars: ✭ 200 (+334.78%)
Mutual labels:  networks
PancakeTokenSniper
BSC BNB Pancake token sniper, buy, take profit and rug check
Stars: ✭ 184 (+300%)
Mutual labels:  trade
coincube
A Python/Vue.js crypto portfolio management and trade automation program with support for 10 exchanges.
Stars: ✭ 85 (+84.78%)
Mutual labels:  trade
LiquiDEX
2-steps non-interactive atomic swap protocol for Liquid
Stars: ✭ 13 (-71.74%)
Mutual labels:  trade

Economic Complexity and Product Complexity

by the Growth Lab at Harvard's Center for International Development

This package is part of Harvard Growth Lab’s portfolio of software packages, digital products and interactive data visualizations. To browse our entire portfolio, please visit growthlab.app. To learn more about our research, please visit Harvard Growth Lab’s home page.

About

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 ecomplexity

Usage:

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)

Arguments:

data: pandas dataframe containing production / trade data.
    Including variables indicating time, location, product and value
cols_input: dict of column names for time, location, product and value.
    Example: {'time':'year', 'loc':'origin', 'prod':'hs92', 'val':'export_val'}
presence_test: str for test used for presence of industry in location.
    One of "rca" (default), "rpop", "both", or "manual".
    Determines which values are used for M_cp calculations.
    If "manual", M_cp is taken as given from the "value" column in data
val_errors_flag: {'coerce','ignore','raise'}. Passed to pd.to_numeric
    *default* coerce.
rca_mcp_threshold: numeric indicating RCA threshold beyond which mcp is 1.
    *default* 1.
rpop_mcp_threshold: numeric indicating RPOP threshold beyond which mcp is 1.
    *default* 1. Only used if presence_test is not "rca".
pop: pandas df, with time, location and corresponding population, in that order.
    Not required if presence_test is "rca" (default).
continuous: Used to calculate product proximities, indicates whether
    to consider correlation of every product pair (True) or product
    co-occurrence (False). *default* False.
asymmetric: Used to calculate product proximities, indicates whether
    to generate asymmetric proximity matrix (True) or symmetric (False).
    *default* False.

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].