Skip to main content

Pyndex: A python package for Russell index reconstruction.

Project description

pyndex: the python reconstructor for the FTSE Russell US indexes.

What is it?

pyndex is a Python package developed to reconstruct the Russell US indexes. It is based on the results of the paper:

Evidence of Crowding on Russell 3000 Reconstitution Events

Main features

Here are the main features of pyndex:

  1. Reconstruction of Russell U.S. indexes to great accuracy
  2. Point in time control of index constituents
  3. Calendar for Index reconstruction for each year from 1989

Where to get it

The source code is currently hosted in the following GitHub repository folder:

Binary installers for the latest released version are available at the Python package index. To install type on your terminal:

# PyPI
pip install pyndex-fin

Citation

Please use following citation to cite pyndex in scientific publications:

Bibtex entry:

@misc{aless2020evidence,
    title={Evidence of Crowding on Russell 3000 Reconstitution Events},
    author={Alessandro Micheli and Eyal Neuman},
    year={2020},
    eprint={2006.07456},
    archivePrefix={arXiv},
    primaryClass={q-fin.TR}
}

License

The software is distributed under GNU General Public License v3.0.

Usage

The package can reconstruct the Russell 1000, 2000 and 3000 index. The index to be reconstructed is passed via the argument index as "1000", "2000" and "3000", respectively. The oldest year supported is 1989.

First, start your connection to the WRDS database.

>>> import wrds
>>> db = wrds.Connection()
Loading library list...
Done

Then pass your WRDS connection to the package along with the parameters year and index.

>>> import pyndex as px
>>> index = px.Index.from_wrds(db, year = 2010, index = "3000")
>>> calendar = px.Index.get_calendar(year = 2010)

The method px.Index.from_wrds() will return a pandas MultiIndex DataFrame containing the index weights identified by permno, permco and cusip. The method px.Index.get_calendar() will return the index reconstruction calendar for the corresponding year.

One can join a sequence of year in a single DataFrame using px.join.

>>> index_2010 = px.Index.from_wrds(db, year = 2010, index = "3000")
>>> index_2011 = px.Index.from_wrds(db, year = 2011, index = "3000")
>>> new_index = px.join([index_2010,index_2011])

To check the difference of index constituents between two points in time you can use px.diff as follows,

>>> index_2010 = px.Index.from_wrds(db, year = 2010, index = "3000")
>>> slice_1 = index_2010["2010-08-20","2010-08-20"]
>>> slice_2 = index_2010["2010-09-20","2010-09-20"]
>>> additions, deletions = px.diff(slice_1, slice_2)

The first value contains the index additions from slice_1 to slice_2 while the second one contains the index deletions. This is particularly useful if one has to find the index addition between two index events, e.g. the annual rebalance and the Q3 quarterly additions.

In this case one would use px.diff as follows.

>>> index_2010 = px.Index.from_wrds(db, year = 2010, index = "3000")
>>> annual_rebalance = index_2010["2010-06-25":"2010-06-25"]
>>> q3_rebalance = index_2010["2010-09-17":"2010-09-17"]
>>> additions, deletions = px.diff(annual_rebalance, q3_rebalance)

Getting Help

For any usage or installation questions, please get in touch with Alessandro Micheli at am1118@ic.ac.uk .

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

pyndex-fin-0.1.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

pyndex_fin-0.1.1-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file pyndex-fin-0.1.1.tar.gz.

File metadata

  • Download URL: pyndex-fin-0.1.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for pyndex-fin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 091c64a069d3b81dabdf63d683f001d48ba824a5032444caf1ab610f3e8be50f
MD5 2aaea98086dec1a6d2f17cb2a597241b
BLAKE2b-256 51e768890a3921d4b41368703a9e355baf60da25ef8eaebe20471ba7d37c2821

See more details on using hashes here.

File details

Details for the file pyndex_fin-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyndex_fin-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for pyndex_fin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3053b1d754c9fb819180de5e0956e44ab6bf2f11744ce8d206c4151fd57aa50
MD5 0c9da4eeead24b0ca20ac5bb74717deb
BLAKE2b-256 f3d3d583c2c5c12c962902d731ae4986de9c6cc96c36879ef30dcf619d9cafb1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page