From the course: Algorithmic Trading and Finance Models with Python, R, and Stata Essential Training

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Financial data and Python

Financial data and Python

- [Instructor] While we pull in a significant amount of data into Python from a variety of different sources, most of the time, we're going to need to make some sort of modifications to that data in order to get the output that we're looking for. We may have to add new columns, calculate changes or logs of particular variables, merge different datasets together. We're going to need to do something in most cases though. Let's take a look at how we'd begin that process. I'm in the 02_05_Begin file, which is just a Jupyter Notebook file that imported pandas, pandas_datareader, and datetime, and then created a dataset called aapl. Now, what I want to do from here is to go through and add a new column to our dataset. And the idea is that maybe we're interested not necessarily in either the open or close price for Apple, but maybe we're interested in the change in price for a particular day. And to do that, I'm going to define the change as being based on the open price versus the close…

Contents