Skip to content

QuantEcon/QuantEcon.py

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

QuantEcon.py

A high performance, open source Python code library for economics

  from quantecon.markov import DiscreteDP
  aiyagari_ddp = DiscreteDP(R, Q, beta)
  results = aiyagari_ddp.solve(method='policy_iteration')

Build Status Coverage Status Documentation Status

Installation

Before installing quantecon we recommend you install theĀ AnacondaĀ Python distribution, which includes a full suite of scientific python tools.Ā Note:Ā quantecon is now only supporting Python version 3.5+. This is mainly to allow code to be written taking full advantage of new features such as using the @ symbol for matrix multiplication. Therefore please install the latest Python 3 Anaconda distribution.

Next you can install quantecon by opening a terminal prompt and typing

pip install quantecon

Usage

OnceĀ quanteconĀ has been installed you should be able to import it as follows:

import quantecon as qe

You can check the version by running

print(qe.__version__)

If your version is below what’s available onĀ PyPIĀ then it is time to upgrade. This can be done by running

pip install --upgrade quantecon

Examples and Sample Code

Many examples of QuantEcon.py in action can be found atĀ Quantitative Economics. See also the

QuantEcon.py is supported financially by theĀ Alfred P. Sloan FoundationĀ and is part of theĀ QuantEcon organization.

Downloading theĀ quanteconĀ Repository

An alternative is to download the sourcecode of theĀ quanteconĀ package and install it manually fromĀ the github repository. For example, if you have git installed type

git clone https://github.com/QuantEcon/QuantEcon.py

Once you have downloaded the source files then the package can be installed by running

pip install flit
flit install

(To learn the basics about setting up Git seeĀ this link.)