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

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

CSVs and Python

CSVs and Python

- [Instructor] Now, one thing you'll often want to do when you're working in Python is to pull data that you've gathered in Python out and turn it into a CSV file. There's a variety of reasons you might want to do this. For one thing, it's much easier to visualize the data in Excel and to do, kind of, basic preliminary type calculations to evaluate if your strategy makes any sense using Excel. Similarly, if you're trying to pull data through Python but perhaps do your manipulation and calculations in R or Stata, then it's often easier to transfer those files using CSV, rather than using the Python files directly. So, let's take a look at how we could do this using Python. I'm in the 02_04_Begin file, which is just our blank Jupyter notebook file. So I'm going to begin by importing our pandas as pd and similarly I'm going to import our pandas_datareader as pdr. And next up I want to import a function called datetime, and the datetime function is just going to let us pull information…

Contents