Analysing stock prices with Python