FT USA

Jan 11-12, 2018

9:00 am -4:30 pm

Instructors: Thomas Tu

Helpers:

General Information

Software for data science in an industry environment. This workshop aims to introduce software as a skill, not a specialty.

Who: The course is aimed at technical working professionals who are interested in leveraging the software ecosystem to help operationalize and productize their work. You don't need to have any previous knowledge of the tools that will be presented at the workshop.

Where: 1500 Broadway Suite 400, Oakland CA. Get directions with OpenStreetMap or Google Maps.

When: Jan 11-12, 2018. Add to your Google Calendar.

Requirements: Participants must bring a laptop and should have a strong technical background, but may have little or no programming experience.

Contact: Please email ttu@energy-solution.com for more information.

Jupyterhub Instance: https://ftusa-wkshop.thomastu.io


Schedule

Day 1 09:00 1. Running and Quitting How can I run Python programs?
09:15 2. Variables and Assignment How can I store data in programs?
09:35 3. Data Types and Type Conversion What kinds of data do programs store?
How can I convert one type to another?
09:55 4. Built-in Functions and Help How can I use built-in functions?
How can I find out what they do?
What kind of errors can occur in programs?
10:20 5. Morning Coffee Break
10:35 6. Libraries How can I use software that other people have written?
How can I find out what that software does?
10:55 7. Reading Tabular Data into DataFrames How can I read tabular data?
11:15 8. Pandas DataFrames How can I do statistical analysis of tabular data?
11:45 9. Plotting How can I plot my data?
12:15 10. Lunch Break
13:00 11. Lists How can I store multiple values?
13:20 12. For Loops How can I make a program do many things?
13:45 13. Looping Over Data Sets How can I process many data sets with a single command?
14:00 14. Writing Functions How can I create my own functions?
14:25 15. Variable Scope How do function calls actually work?
How can I determine where errors occurred?
14:45 16. Afternoon Coffee Break
15:00 17. Conditionals How can programs do different things for different data?
15:25 18. Programming Style How can I make my programs more readable?
How do most programmers format their code?
How can programs check their own operation?
15:55 19. Wrap-Up What have we learned?
What else is out there and where do I find it?
16:15 20. Feedback How did the class go?
16:30 Finish
Day 2 09:00 21. Introducing the Shell What is a command shell and why would I use one?
09:05 22. Navigating Files and Directories How can I move around on my computer?
How can I see what files and directories I have?
How can I specify the location of a file or directory on my computer?
09:30 23. Working With Files and Directories How can I create, copy, and delete files and directories?
How can I edit files?
09:45 24. Shell Scripts How can I save and re-use commands?
10:30 25. Morning Coffee Break
10:45 26. Automated Version Control What is version control and why should I use it?
10:50 27. Setting Up Git How do I get set up to use Git?
10:55 28. Creating a Repository Where does Git store information?
11:00 29. Tracking Changes How do I record changes in Git?
How do I check the status of my version control repository?
How do I record notes about what changes I made and why?
11:10 30. Exploring History How can I identify old versions of files?
How do I review my changes?
How can I recover old versions of files?
11:20 31. Ignoring Things How can I tell Git to ignore files I don’t want to track?
11:25 32. Remotes in GitHub How do I share my changes with others on the web?
11:55 33. Hosting Where should I host my version control repositories?
12:05 34. Lunch Break
12:50 35. Selecting Data How can I get data from a database?
13:05 36. Filtering How can I select subsets of data?
13:25 37. Creating and Modifying Data How can I create, modify, and delete tables and data?
13:50 38. Programming with Databases - Python How can I access databases from programs written in Python?
14:25 39. Data Warehousing What is a datawarehouse?
How can I leverage relational databases for reporting and BI?
How can I use python to populate a datawarehouse for Tableau?
15:25 40. Workflow How do we write code for operational use?
15:40 41. Structuring Local Software What is the structure of a python package?
What is the structure of a python script?
15:55 42. Sharing and Publishing Work Internally
16:10 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.


Setup

To participate in a Software Carpentry workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.

We maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.

The Bash Shell

Bash is a commonly-used shell that gives you the power to do simple tasks more quickly.

Windows

Video Tutorial
  1. Download the Git for Windows installer.
  2. Run the installer and follow the steps bellow:
    1. Click on "Next".
    2. Click on "Next".
    3. Keep "Use Git from the Windows Command Prompt" selected and click on "Next". If you forgot to do this programs that you need for the workshop will not work properly. If this happens rerun the installer and select the appropriate option.
    4. Click on "Next".
    5. Keep "Checkout Windows-style, commit Unix-style line endings" selected and click on "Next".
    6. Keep "Use Windows' default console window" selected and click on "Next".
    7. Click on "Install".
    8. Click on "Finish".
  3. If your "HOME" environment variable is not set (or you don't know what this is):
    1. Open command prompt (Open Start Menu then type cmd and press [Enter])
    2. Type the following line into the command prompt window exactly as shown:

      setx HOME "%USERPROFILE%"

    3. Press [Enter], you should see SUCCESS: Specified value was saved.
    4. Quit command prompt by typing exit then pressing [Enter]

This will provide you with both Git and Bash in the Git Bash program.

macOS

The default shell in all versions of macOS is Bash, so no need to install anything. You access Bash from the Terminal (found in /Applications/Utilities). See the Git installation video tutorial for an example on how to open the Terminal. You may want to keep Terminal in your dock for this workshop.

Linux

The default shell is usually Bash, but if your machine is set up differently you can run it by opening a terminal and typing bash. There is no need to install anything.

Git

Git is a version control system that lets you track who made changes to what when and has options for easily updating a shared or public version of your code on github.com. You will need a supported web browser (current versions of Chrome, Firefox or Safari, or Internet Explorer version 9 or above).

You will need an account at github.com for parts of the Git lesson. Basic GitHub accounts are free. We encourage you to create a GitHub account if you don't have one already. Please consider what personal information you'd like to reveal. For example, you may want to review these instructions for keeping your email address private provided at GitHub.

Windows

Git should be installed on your computer as part of your Bash install (described above).

macOS

Video Tutorial

For OS X 10.9 and higher, install Git for Mac by downloading and running the most recent "mavericks" installer from this list. After installing Git, there will not be anything in your /Applications folder, as Git is a command line program. For older versions of OS X (10.5-10.8) use the most recent available installer labelled "snow-leopard" available here.

Linux

If Git is not already available on your machine you can try to install it via your distro's package manager. For Debian/Ubuntu run sudo apt-get install git and for Fedora run sudo dnf install git.

Text Editor

When you're writing code, it's nice to have a text editor that is optimized for writing code, with features like automatic color-coding of key words. The default text editor on macOS and Linux is usually set to Vim, which is not famous for being intuitive. if you accidentally find yourself stuck in it, try typing the escape key, followed by :q! (colon, lower-case 'q', exclamation mark), then hitting Return to return to the shell.

Windows

Video Tutorial

nano is a basic editor and the default that instructors use in the workshop. To install it, download the Software Carpentry Windows installer and double click on the file to run it. This installer requires an active internet connection.

Others editors that you can use are Notepad++ or Sublime Text. Be aware that you must add its installation directory to your system path. Please ask your instructor to help you do this.

macOS

nano is a basic editor and the default that instructors use in the workshop. See the Git installation video tutorial for an example on how to open nano. It should be pre-installed.

Others editors that you can use are Text Wrangler or Sublime Text.

Linux

nano is a basic editor and the default that instructors use in the workshop. It should be pre-installed.

Others editors that you can use are Gedit, Kate or Sublime Text.

Python

Python is a popular language for research computing, and great for general-purpose programming as well. Installing all of its research packages individually can be a bit difficult, so we recommend Anaconda, an all-in-one installer.

Regardless of how you choose to install it, please make sure you install Python version 3.x (e.g., 3.6 is fine).

We will teach Python using the Jupyter notebook, a programming environment that runs in a web browser. For this to work you will need a reasonably up-to-date browser. The current versions of the Chrome, Safari and Firefox browsers are all supported (some older browsers, including Internet Explorer version 9 and below, are not).

Windows

Video Tutorial
  1. Open https://www.anaconda.com/download/#windows with your web browser.
  2. Download the Python 3 installer for Windows.
  3. Install Python 3 using all of the defaults for installation except make sure to check Make Anaconda the default Python.

macOS

Video Tutorial
  1. Open https://www.anaconda.com/download/#macos with your web browser.
  2. Download the Python 3 installer for OS X.
  3. Install Python 3 using all of the defaults for installation.

Linux

  1. Open https://www.anaconda.com/download/#linux with your web browser.
  2. Download the Python 3 installer for Linux.
    (The installation requires using the shell. If you aren't comfortable doing the installation yourself stop here and request help at the workshop.)
  3. Open a terminal window.
  4. Type
    bash Anaconda3-
    and then press tab. The name of the file you just downloaded should appear. If it does not, navigate to the folder where you downloaded the file, for example with:
    cd Downloads
    Then, try again.
  5. Press enter. You will follow the text-only prompts. To move through the text, press the space key. Type yes and press enter to approve the license. Press enter to approve the default location for the files. Type yes and press enter to prepend Anaconda to your PATH (this makes the Anaconda distribution the default Python).
  6. Close the terminal window.

SQLite

SQL is a specialized programming language used with databases. We use a simple database manager called SQLite in our lessons.

Windows

The Software Carpentry Windows Installer installs SQLite for Windows. If you used the installer to configure nano, you don't need to run it again.

macOS

SQLite comes pre-installed on macOS.

Linux

SQLite comes pre-installed on Linux.

If you installed Anaconda, it also has a copy of SQLite without support to readline. Instructors will provide a workaround for it if needed.