Resources

Books

Installing Mamba and Python packages

Newspapers

Digital access to the NYTimes and the Washington Post are available to all USNA students. Both (and especially the NYTimes) do a good job of data-driven reporting. We will access them both for class.

To sign up for the NYTimes, go here, enter “United States Naval Academy,” and create an account using your usna.edu email address.

To sign up for the Washington Post, go here, and enter your usna.edu email address to create a free account.

Working on a remote Jupyter notebook

When you run a Jupyter notebook, it sets up the Python kernel which is actually running your code, and a web server which serves the page you interact with it through. You can access that server remotely, which lets you run code on that faster machine over there, and interact with it with a machine over here.

  1. SSH onto the remote machine as normal, with no special flags.
  2. On the remote machine, run jupyter lab --no-browser --ip=0.0.0.0 --port=2XXXX where the XXXX is the last four numbers of your alpha.
  3. It will output a URL that looks something like this: http://ward-rweb-09:(your port)/?token=SOMELONGHASH. Copy it, and paste it into your local browser.

How to destroy a mamba installation

From time to time, we must destroy so we can build anew. If I suggest you should destroy your mamba/conda installation so you can build a new one, here’s the steps to take.

First, you have a file in your home directory ~/.bashrc which we need to edit. You can do this with a text editor of your choice. nano ~/.bashrc will open up a text editor (you may know a better editor like emacs or vi). At the bottom is a block that looks like this:

# >>> conda initialize >>>
some code
# <<< conda initialize <<<

Delete that block, and save and exit.

Second, we’ll want to delete everything that has previously been installed. Here’s a big list - if some directory doesn’t exist from your installation, just remove it from the command and try again:

rm -rf ~/.conda ~/anaconda3 ~/mambaforge ~/.ipython ~/.jupyter

Get a cup of coffee, that might take a while. Then, reinstall Mamba.

Installing Mamba

Ssh into ssh.cs.usna.edu, and install mambaforge, by running wget --no-check-certificate https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh (the no-check-certificate is bad practice made necessary by the monitoring software run by ITSD).

Run it by running bash Mambaforge-Linux-x86_64.sh. Follow the prompts, and answer “yes” to all questions.

Close the terminal and reopen it.

Run mamba install numpy scipy scikit-learn pandas plotly matplotlib jupyter to get the base packages installed.

Working with AWS