Chapter 11 Portfolio-Building Project, Imperative Programming

In this chapter we’ll return to a data set that you are already familiar with from the R portion of the course. We already discussed some specific and interesting research questions that you should have tried to answer, not we’re going to implement those solutions in Python!

11.1 Project and Environment set-up

Exercise 11.1 (Create a new folder) First, creade a new directory/folder on your computer in an appropriate place. Copy the dataset that you have been using so far into the data sub-folder.
Exercise 11.2 (Start VS Code) Navigate to this directory in your terminal and begin VS Code by using the code . command.
Exercise 11.3 (Begin a new virtual environment) Start by making a new virtual environment in VS Code. Use the appropriate command in the integrated terminal window, as described in the first chapter.
Exercise 11.4 (Activate the virtual environment) Ensure that your virtual environment is activated. You may need to run a command, as described in the first chapter, but VS Code will likely ask if you want to activate the virtual environment.
Exercise 11.5 (Install the necessary libraries) Install the necessary libraries that you’ll use in your project.
Exercise 11.6 (Import packages) Begin your script by importing the necessary packages as shown, e.g.
import numpy as np
import pandas as pd
Exercise 11.7 (Complete your Script) Continue to develop your script to carry out the analysis that you’ve done in R. This will help you to see the relationship between the two languages and to deepen your Python skills.