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:
- where to write python code
- how to create python environment with all required dependencies
- how to do code versioning and use github to submit your answers
I recommend one of two options:
- 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.
- 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.ymlat the end of this page. It will create a
econ31340-envenvironment 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
- Finally, either select the
econ31340-envin 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.