I am trying to find a way to create Real Estate Index using Python 3.6 for my high school project. I have a csv file with the following columns:

  • Date of Sale
  • Amount
  • Type (Commercial/Residential/Industrial)
  • State
  • Number of Investor

I want to create an index for each of the different types of properties, and then also compare it to the S&P 500, using data since about 2005.

  1. I have been learning from Python for Finance by Yves Hilpisch, but cannot find mention of creating a custom index.
  2. So far, I created a moving average of quarterly transactions, and it does show a very good visual and a near complete slowdown between 2007 to 2010. But is that a real index?
  3. My Y-Axis is in the Millions, but I would like it to be a much smaller number like the S&P 500. Can I just divide all cumulative figures by 10^6?

Could someone point me to some good (and free since my allowance is small) resource to learn about this?

Thank you so much.

  • 1
    $\begingroup$ A moving average of quarterly transactions is a start, but a concern in the home price context is that average prices change over time due to changing composition of transactions (eg. bigger or smaller homes are being sold over time) rather than changing prices. This is why the Case-Schiller index uses transactions matched on home. I don't know if you have the capacity to that with your data. On question (3), the answer is yes. You may try economics.stackexchange.com as they are more entertaining of student questions. good luck! $\endgroup$ Commented Aug 28, 2017 at 19:46
  • $\begingroup$ shouldnt it be the median instead of averages $\endgroup$
    – Rime
    Commented Aug 29, 2017 at 4:40

1 Answer 1


I suppose you don't have to constrain yourself to that specific data, so you could refer to the Census Bureau if you need more data. Moreover, you can search on Google for ''housing index methodology'' if you want references on how to build professional indexes. Personally, I think it would be great practice to replicate an index for your high-school project (remember to state in your work that it is not an original idea and to quote the sources). However, your teacher might think it is better that you come up with something yourself, even if not so elaborate. In that case, I would suggest you think about the following:

1) Which variables are useful, and for what they are used. Here are some guidelines:

  • date: to see the evolution in time, but also allows you to aggregate by period and see: if you have seasonality, if the annual/quarterly count of transactions has increased or decreased, the time between transactions, etc.
  • amount: by the amount, you can cathegorize within the three categories that you already have and possibly distinguish whether the real estate being bought/sold is cheap or luxury (this is a good indicator of the state of the economy)
  • type: compare with indexes related to each one (confidence indexes, activity indexes, etc)
  • state: some regions are more industrial, while others are more residential. Your index could indicate the market evolution in each state by pointing out the evolution of activity for each of the three categories;
  • number of investor: some investors buy one house to live in and that is it, while others might do this as a business. If a number only appears once in the dataset, you probably have the first case, while if it appears many times you are probably facing an institutional investor.

2) An index should give you a quick assessment of the market over time. You should be able to compare two moments and tell whether the market is better or worse (should you invest in it or not), but you might also want to build something that gives more details on the market that you are observing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.