Skip to content

Python workshop for the 2019 Earth Sciences REU cohort at the University of Hawaii at Manoa

Notifications You must be signed in to change notification settings

leouieda/2019-06-reu-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Python Workshop for the 2019 Earth Sciences REU

Instructor: Leonardo Uieda

When: Mondays. 12:00 pm - 01:00 pm

Where: Room 807 in the POST building (Duennebier Collaboratorium)

What: We will teach a hands-on introduction to the Python programming language. You will not fall asleep with PowerPoint slides full of code, calculate Fibonacci numbers, organize lists of names, print all odd numbers between 0 and 30, or any of that programmer nonsense. You will write code from the start, work in pairs/groups, download data from the internet, load data, perform linear regressions, make figures and maps, and other things that you will actually need to do on a daily basis.

Bring: Participants must bring their own computers (Mac, Windows, or Linux) with the required software already installed (see What to install below). Contact me if you need any help before the workshop.

Goals

This is going to be a hands-on workshop of the basic concepts you'll need to use Python for your research and studies. Participants who complete the workshop should be able to use Python to gather data from one or more files, process the data, run an analysis, make publication quality figures, and save the output.

Schedule

Topics
Day 1
Introductions
Computational thinking exercise
Day 2
Variables, data types, and operations
Day 3
TBD
...

Running Python online

You can run Python online for this workshop at: https://mybinder.org/v2/gh/leouieda/2019-06-reu-python/master?urlpath=lab

This can be used in case you didn't manage to install Python in time.

Shared class notes

We'll use Google Docs to edit shared class notes. Please keep the document open during class. You can post questions/comments/whatever on the notes or on the group chat.

https://docs.google.com/document/d/124kOkDM8woxoLRpMKCwzsBh7XB47aLWTYWZkJ_OA77I

Data

Throughout the workshop, we will work with temperature data from Berkeley Earth.

We'll start working with the time series of average temperature in Hawaii and try to reproduce the figure from the website using Python tools.

Next, we will automatically download the temperature time series for a list of countries, make plots, and run some analysis on the data.

The data files are available in the data folder just in case we have network problems. The files were downloaded using the script download-data.py which is what we would write on day 2.

What to install

There are many ways to get Python on your system and it can be very confusing when you're first starting out. I don't recommend downloading it from python.org or using the Python that came with your system (common on Linux). Instead, use the Anaconda distribution. It will come with all the libraries you'll need and doesn't require administrative access to install.

Go to https://www.anaconda.com/distribution/#download-section and select the Python 3.7 version of the installer for your system. It's safe to use all the default configuration options when installing.

Even if you already have Python (say from your system package manager or ArcGIS, etc), I recommend that you install Anaconda to avoid problems with versioning.

You'll also need a text editor. If you don't already have one of your choice, I recommend installing Sublime Text (it's available for Linux, Windows, and Mac).

Windows users will also need to download Git For Windows from https://gitforwindows.org to get access to a Linux-like terminal.

Please install all software BEFORE comming to the workshop. If you have any problems installing or don't know which version you need to download, come talk to me.

Recommended Literature

We will loosely follow the Python lessons from Software Carpentry. I highly recommend taking a look at all of their material. Everything there is worth learning.

See this blog post for more resources for getting started in Python: http://www.leouieda.com/blog/getting-started-with-python-for-science.html

To perfect your Python-fu, I highly recommend trying to solve the Python Challenge. It's a fun way to learn general Python skills, like parsing text, downloading web content, regular expressions, and much more. The challenges are usually very difficult but also very rewarding when you can complete them.

License

Creative Commons License
This content is licensed under a Creative Commons Attribution 4.0 International License.

About

Python workshop for the 2019 Earth Sciences REU cohort at the University of Hawaii at Manoa

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published