Skip to content

Homework Instructions

Yu-Chen, Den edited this page Jul 4, 2024 · 1 revision

Welcome to the Quant-Finance wiki!

This page is for those unfamiliar with basic programming and Command Line Interface (CLI).


Folders

Every homework will contain three folders

  • src: Default code for this homework
  • data: Data in use
  • hw1 or something similar: Document (usually in .pdf format, please ignore the .tex file if you have no idea wtf that is)

Start

To start writing your homework, you must first set up your local Python environment. Creating a virtual environment is a better way to prevent package version conflict.

python3 -m venv your_venv

Where your_venv can be changed by yourself. After creating the virtual environment, your terminal may be like

(your_venv) ~/path>  

Next, install all the required packages into that virtual environment

pip3 install -r requirements.txt

Execute Python scripts

(Use your terminal instead of Jupyter notebook please)

Once you clone the repo into your computer, the root path will be ~/Quant-Finance. For example, if you want to execute the main.py script in HWs folder, you need to change the current directory to ~/Quant-Finance/HWs. Just type cd HWs.

~/Quant-Finance> cd HWs
~/Quant-Finance/HWs>

Once you changed your current directory to HWs, you can execute src/main.py by typing python -m src.main

~/Quant-Finance/HWs> python -m src.main

What does that -m mean?

Clone this wiki locally