Skip to content

Getting started

Here we will see how to get started to run the code on this website and how to submit problem sets. We will do this using conda, git and github.

We cover two main concepts:

  1. where to write python code
  2. how to create python environment with all required dependencies
  3. how to do code versioning and use github to submit your answers

Development environment

I recommend one of two options:

  1. Use VS Code which is a free and open source code editor by Microsoft. It supports python notebook and will also handle connecting to github for you.
  2. Use the Jupyter Lab Desktop which will give you a fully bundled setup to write notebooks.

Creating a python environment

This really requires two steps:

  • Install conda for your platform, find how to do that here Installing conda

  • Use the provided environment file environment.yml at the end of this page. It will create a econ31340-env environment with all dependencies, this includes python, jupyter, numpy, pandas, tensorflow, etc...

conda env create -f environment.yml

alternatively, you can use the conda interface/navigator to create the environment from the environment.yml file

  • Finally, either select the econ31340-env in your jupyter notebook, or activate your environment in the terminal
conda activate econ21340-env 

The environment file

The content of the environment.yml file is

name: econ31340-env
channels:
  - defaults
  - conda-forge
dependencies:
  - python>=3.7 
  - numpy
  - matplotlib
  - pandas
  - seaborn
  - tqdm
  - tensorflow
  - keras
  - jupyter
  - nb_conda_kernels

Submitting problem set via github

This is arguably an overkill, however the goal is for you to get comfortable with using git and github.

What are git and github

Git is a versioning software. Basically, it keeps track of all changes applied to a designated folder. Such code history is called a repository. Repositories are stored locally on your machines and can be synced to remote repositories. We will use github which is simply an online git server with additional features.

Accessing and submitting homeworks

Git can be used in the terminal or via a GUI application. For the latter I would recommend using sourcetree, which is free and available for both mac and windows.

To initialize a git repository you need to access the link I will share for the github classroom. This will require a github account.

When you follow that link, it will create a repository for you that you can then clone, edit, commit and push to.

For each homework there will also be an associated pull request where you can communicate with me or the TA.