Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 108 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,152 @@
# D-Lab's Python Fundamentals Workshop
# D-Lab Python Fundamentals Workshop

[![Datahub](https://img.shields.io/badge/launch-datahub-blue)](https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fdlab-berkeley%2FPython-Fundamentals&urlpath=tree%2FPython-Fundamentals%2F&branch=main) [![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/dlab-berkeley/Python-Fundamentals/main?urlpath=tree)
[![Datahub](https://img.shields.io/badge/launch-datahub-blue)](https://dlab.datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fdlab-berkeley%2FPython-Fundamentals&urlpath=lab%2Ftree%2FPython-Fundamentals%2F&branch=main)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dlab-berkeley/Python-Fundamentals/HEAD)
[![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)

This repository contains the materials for D-Lab’s Python Fundamentals workshop. No prior experience with Python is required.
This repository contains the materials for D-Lab’s Python Fundamentals workshop.
No prior experience with Python is required to attend this workshop.

## Workshop Goals

In this workshop, we provide an introduction to Python. We do so in four main parts:
This four-part, interactive workshop series is your complete introduction to
programming Python for people with little or no previous programming experience.
By the end of the series, you will be able to apply your knowledge of basic
principles of programming and data manipulation to a real-world social science
application.

* **Part 1**: Introduction to Python and Jupyter Notebooks, variables, data types, and functions.
Each of the parts is divided into a lecture-style coding walkthrough interrupted
by challenge problems, discussions of the solutions, and breaks. Instructors and
TAs are dedicated to engaging you in the classroom and answering questions in
plain language.

* **Part 1**: Introduction to Python and Jupyter Notebooks, variables, data
types, and functions.
* **Part 2**: Data structures, loops, conditionals, and creating functions.
* **Part 3**: Libraries, File I/O, and scientific computing.
* **Part 4**: Error handling, style, and an applied, in-depth project.

## Installation Instructions

Anaconda is a useful package management software that allows you to run Python and Jupyter notebooks very easily. Installing Anaconda is the easiest way to make sure you have all the necessary software to run the materials for this workshop. Complete the following steps:
Anaconda is a useful package management software that allows you to run Python
and Jupyter notebooks easily. Installing Anaconda is the easiest way to make
sure you have all the necessary software to run the materials for this workshop.
If you would like to run Python on your own computer, complete the following
steps prior to the workshop:

1. [Download and install Anaconda (Python 3.9 distribution)](https://www.anaconda.com/products/individual). Click "Download" and then click 64-bit "Graphical Installer" for your current operating system.
1. [Download and install Anaconda (Python 3.9
distribution)](https://www.anaconda.com/products/individual). Click the
"Download" button.

2. Download the [Python-Fundamentals workshop materials](https://github.com/dlab-berkeley/Python-Fundamentals):
2. Download the Python Fundamentals [workshop
materials](https://github.com/dlab-berkeley/Python-Fundamentals):

* Click the green "Code" button in the top right of the repository information.
* Click "Download Zip".
* Extract this file to a folder on your computer where you can easily access it (we recommend Desktop).
- Click the green "Code" button in the top right of the repository
information.
- Click "Download Zip".
- Extract this file to a folder on your computer where you can easily
access it (we recommend Desktop).

3. Optional: if you're familiar with `git`, you can instead clone this repository by opening a terminal and entering `git clone git@github.com:dlab-berkeley/Python-Fundamentals.git`.
3. Optional: if you're familiar with `git`, you can instead clone this
repository by opening a terminal and entering the command `git clone
git@github.com:dlab-berkeley/Python-Fundamentals.git`.

## Run the code
## Is Python Not Working on Your Laptop?

Now that you have all the required software and materials, you need to run the code:
If you do not have Anaconda installed and the materials loaded on your workshop
by the time it starts, we *strongly* recommend using the D-Lab Datahub to
run the materials for these lessons. You can access the DataHub by clicking the
following button:

1. Open the Anaconda Navigator application. You should see the green snake logo appear on your screen. Note that this can take a few minutes to load up the first time.
[![Datahub](https://img.shields.io/badge/launch-datahub-blue)](https://dlab.datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fdlab-berkeley%2FPython-Fundamentals&urlpath=lab%2Ftree%2FPython-Fundamentals%2F&branch=main)

2. Click the "Launch" button under "Jupyter Notebooks" and navigate through your file system to the `Python-Fundamentals` folder you downloaded above.
The DataHub downloads this repository, along with any necessary packages, and
allows you to run the materials in a Jupyter notebook that is stored on UC
Berkeley's servers. No installation is necessary from your end - you only need
an internet browser and a CalNet ID to log in. By using the DataHub, you can
save your work and come back to it at any time. When you want to return to your
saved work, just go straight to [DataHub](https://datahub.berkeley.edu), sign
in, and you click on the `Python-Fundamentals` folder.

3. In the folder, open the `00_workshop_setup.ipynb` to begin.
If you don't have a Berkeley CalNet ID, you can still run these lessons in the
cloud, by clicking this button:

4. Press Shift + Enter (or Ctrl + Enter) to run a cell.
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/dlab-berkeley/Python-Fundamentals/HEAD)

## Is Python not working on your laptop?
Binder operates similarly to the D-Lab DataHub, but on a different set of
servers. By using Binder, however, you cannot save your work.

If you do not have Anaconda installed and the materials loaded on your workshop by the time it starts, we *strongly* recommend using the UC Berkeley Datahub to run the materials for these lessons. You can access the DataHub by clicking this button:
## Run the Code

[![Datahub](https://img.shields.io/badge/launch-datahub-blue)](https://datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fdlab-berkeley%2FPython-Fundamentals&urlpath=tree%2FPython-Fundamentals%2F&branch=main)
Now that you have all the required software and materials, you need to run the
code.

The DataHub downloads this repository, along with any necessary packages, and allows you to run the materials in a Jupyter notebook that is stored on UC Berkeley's servers. No installation is necessary from your end - you only need an internet browser and a CalNet ID to log in. By using the DataHub, you can save your work and come back to it at any time. When you want to return to your saved work, just go straight to [DataHub](https://datahub.berkeley.edu), sign in, and you click on the `Python-Fundamentals` folder.
1. Open the Anaconda Navigator application. You should see the green snake logo
appear on your screen. Note that this can take a few minutes to load up the
first time.

If you don't have a Berkeley CalNet ID, you can still run these lessons in the cloud, by clicking this button:
2. Click the "Launch" button under "JupyterLab" and navigate through your file
system on the left hand pane to the `Python-Fundamentals` folder you
downloaded above. Note that, if you download the materials from GitHub, the
folder name may instead be `Python-Fundamentals-main`.

[![Binder](http://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/dlab-berkeley/Python-Fundamentals/main?urlpath=tree)
3. Open `00_workshop_setup.ipynb` to begin.

By using this button, you cannot save your work unfortunately.
4. Press Shift + Enter (or Ctrl + Enter) to run a cell.

# About the UC Berkeley D-Lab
Note that all of the above steps can be run from the terminal, if you're
familiar with how to interact with Anaconda in that fashion. However, using
Anaconda Navigator is the easiest way to get started if this is your first time
working with Anaconda.

## Additional Resources

D-Lab works with Berkeley faculty, research staff, and students to advance data-intensive social science and humanities research. Our goal at D-Lab is to provide practical training, staff support, resources, and space to enable you to use R for your own research applications. Our services cater to all skill levels and no programming, statistical, or computer science backgrounds are necessary. We offer these services in the form of workshops, one-to-one consulting, and working groups that cover a variety of research topics, digital tools, and programming languages.
Check out the following online resources to learn more about Python:

Visit the [D-Lab homepage](https://dlab.berkeley.edu/) to learn more about us. You can view our [calendar](https://dlab.berkeley.edu/events/calendar) for upcoming events, learn about how to utilize our [consulting](https://dlab.berkeley.edu/consulting) and [data](https://dlab.berkeley.edu/data) services, and check out upcoming [workshops](https://dlab.berkeley.edu/events/workshops).
* [A Byte of Python](https://python.swaroopch.com)
* [Software Carpentry](https://swcarpentry.github.io/)
* [W3Schools](https://www.w3schools.com/python/)

# About the UC Berkeley D-Lab

D-Lab works with Berkeley faculty, research staff, and students to advance
data-intensive social science and humanities research. Our goal at D-Lab is to
provide practical training, staff support, resources, and space to enable you to
use R for your own research applications. Our services cater to all skill levels
and no programming, statistical, or computer science backgrounds are necessary.
We offer these services in the form of workshops, one-to-one consulting, and
working groups that cover a variety of research topics, digital tools, and
programming languages.

Visit the [D-Lab homepage](https://dlab.berkeley.edu/) to learn more about us.
You can view our [calendar](https://dlab.berkeley.edu/events/calendar) for
upcoming events, learn about how to utilize our
[consulting](https://dlab.berkeley.edu/consulting) and [data
services](https://dlab.berkeley.edu/data), and check out upcoming
[workshops](https://dlab.berkeley.edu/events/workshops). Subscribe to our
[newsletter](https://dlab.berkeley.edu/news/weekly-newsletter) to stay up to
date on D-Lab events, services, and opportunities.

# Other D-Lab Python Workshops

Here are other Python workshops offered by the D-Lab:
D-Lab offers a variety of Python workshops, catered toward different levels of
expertise.

### Basic competency
## Introductory Workshops

* [Python Fundamentals](https://github.com/dlab-berkeley/python-fundamentals)
* [Introduction to Pandas](https://github.com/dlab-berkeley/introduction-to-pandas)
* [Geospatial Fundamentals in Python](https://github.com/dlab-berkeley/Geospatial-Fundamentals-in-Python)
- [Python Data Wrangling](https://github.com/dlab-berkeley/Python-Data-Wrangling)
- [Python Data Visualization](https://github.com/dlab-berkeley/Python-Data-Visualization)

### Intermediate/advanced competency
## Intermediate and Advanced Workshops

* [Computational Text Analysis in Python](https://github.com/dlab-berkeley/computational-text-analysis-spring-2019)
* [Introduction to Machine Learning in Python](https://github.com/dlab-berkeley/python-machine-learning)
* [Introduction to Artificial Neural Networks in Python](https://github.com/dlab-berkeley/ANN-Fundamentals)
* [Fairness and Bias in Machine Learning](https://github.com/dlab-berkeley/fairML)
- [Python Geospatial Fundamentals](https://github.com/dlab-berkeley/Geospatial-Data-and-Mapping-in-Python)
- [Python Web Scraping and APIs](https://github.com/dlab-berkeley/Python-Web-Scraping)
- [Python Machine Learning](https://github.com/dlab-berkeley/Python-Machine-Learning)
- [Python Text Analysis](https://github.com/dlab-berkeley/Python-Text-Analysis)
- [Python Deep Learning](https://github.com/dlab-berkeley/Python-Deep-Learning)

# Contributors

* Emily Grabowski
* Pratik Sachdeva
* Christopher Hench
Expand Down