From the course: Algorithmic Trading and Finance Models with Python, R, and Stata Essential Training (2019)
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
CSVs and Python
From the course: Algorithmic Trading and Finance Models with Python, R, and Stata Essential Training (2019)
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.