Data Crunching

Notes beforehand

I am a traditional SAS programmer, and only recently started to develop these python codes in an effort to branch into this new popular programming language. These programs target some of the most fundamental topics in empirical asset pricing, and should serve as a stepping stone for those who are relatively new to the programming world of empirical finance. Of course, these python code probably could use some improvement in coding efficiency, and I welcome any suggestions on that front.

If your institution is already a WRDS subscriber, you can find most of the codes below under the “Research Application” section of WRDS.

Data and platform setup

These codes are written under the WRDS data platform, where relevant empirical data (pricing, fundamental, estimates, etc) are called upon directly through the WRDS API. If your institution has proper WRDS data subscription, you can run the code directly under your Python environment.

Python codes

Setting up sandbox

  • Connecting to WRDSWith the WRDS API, it is very straightforward to connect to WRDS and extract data through Python.

Market anomalies and risk factors

Institutional ownership