• Stars
    star
    168
  • Rank 225,507 (Top 5 %)
  • Language
    Jupyter Notebook
  • License
    Other
  • Created over 8 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

D-Lab's 12 hour introduction to Python. Learn how to create variables and functions, use control flow structures, use libraries, import data, and more, using Python and Jupyter Notebooks.

D-Lab Python Fundamentals Workshop

Datahub Binder License: CC BY 4.0

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

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.

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 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). Click the "Download" button.

  2. Download the Python Fundamentals workshop materials:

    • 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 the command git clone [email protected]:dlab-berkeley/Python-Fundamentals.git.

Is Python Not Working on Your Laptop?

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:

Datahub

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, sign in, and you click on the Python-Fundamentals folder.

If you don't have a Berkeley CalNet ID, you can still run these lessons in the cloud, by clicking this button:

Binder

Binder operates similarly to the D-Lab DataHub, but on a different set of servers. By using Binder, however, you cannot save your work.

Run the Code

Now that you have all the required software and materials, you need to run the code.

  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.

  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.

  3. Open 00_workshop_setup.ipynb to begin.

  4. Press Shift + Enter (or Ctrl + Enter) to run a cell.

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

Check out the following online resources to learn more about 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 to learn more about us. You can view our calendar for upcoming events, learn about how to utilize our consulting and data services, and check out upcoming workshops. Subscribe to our newsletter to stay up to date on D-Lab events, services, and opportunities.

Other D-Lab Python Workshops

D-Lab offers a variety of Python workshops, catered toward different levels of expertise.

Introductory Workshops

Intermediate and Advanced Workshops

Contributors

  • Emily Grabowski
  • Pratik Sachdeva
  • Christopher Hench
  • Rochelle Terman

More Repositories

1

Computational-Social-Science-Training-Program

This course is a rigorous, year-long introduction to computational social science. We cover topics spanning reproducibility and collaboration, machine learning, natural language processing, and causal inference. This course has a strong applied focus with emphasis placed on doing computational social science.
Jupyter Notebook
218
star
2

Machine-Learning-in-R

Workshop (6 hours): preprocessing, cross-validation, lasso, decision trees, random forest, xgboost, superlearner ensembles
CSS
187
star
3

R-Fundamentals-Legacy

D-Lab's 12 hour introduction to R Fundamentals. Learn how to create variables and functions, manipulate data frames, make visualizations, use control flow structures, and more, using R in RStudio.
R
139
star
4

Bash-Git

D-Lab's 3 hour introduction to basic Bash commands and using version control with Git and Github.
131
star
5

R-Deep-Learning

Workshop (6 hours): Deep learning in R using Keras. Building & training deep nets, image classification, transfer learning, text analysis, visualization
R
120
star
6

git-fundamentals

A starting point for discovering the wonderful world of Git, GitHub, and Git Annex (Assistant)
Shell
74
star
7

Stata-Fundamentals

D-Lab's 9 hour introduction to performing data analysis with Stata. Learn how to program, conduct data analysis, create visualization, and conduct statistical analyses in Stata.
Stata
72
star
8

python-for-everything

Materials for teaching the Python for Everything workshop at UC Berkeley's D-lab
Jupyter Notebook
69
star
9

Python-Machine-Learning

D-Lab's 6 hour introduction to machine learning in Python. Learn how to perform classification, regression, clustering, and do model selection using scikit-learn in Python.
Jupyter Notebook
66
star
10

MachineLearningWG

D-Lab's Machine Learning Working Group at UC Berkeley, with supervised & unsupervised learning tutorials in R and Python
HTML
65
star
11

Python-Geospatial-Fundamentals-Legacy

D-Lab's 6 hour introduction to working with geospatial data in Python. Learn how to import, visualize, and analyze geospatial data using GeoPandas in Python.
Jupyter Notebook
57
star
12

Python-Data-Visualization-Legacy

D-Lab's 3 hour introduction to data visualization with Python. Learn how to create histograms, bar plots, box plots, scatter plots, compound figures, and more, using matplotlib and seaborn.
Jupyter Notebook
56
star
13

R-Geospatial-Fundamentals-Legacy

This is the repository for D-Lab's Geospatial Fundamentals in R with sf workshop.
Jupyter Notebook
53
star
14

Python-Data-Wrangling-Legacy

D-Lab's 3 hour introduction to data wrangling in Python. Learn how to import and manipulate dataframes using pandas in Python.
Jupyter Notebook
51
star
15

R-Machine-Learning-Legacy

D-Lab's 6 hour introduction to machine learning in R. Learn the fundamentals of machine learning, regression, and classification, using tidymodels in R.
R
47
star
16

Unsupervised-Learning-in-R

Workshop (6 hours): Clustering (Hdbscan, LCA, Hopach), dimension reduction (UMAP, GLRM), and anomaly detection (isolation forests).
R
47
star
17

python-berkeley

python resources of berkeley curated at a place
Jupyter Notebook
44
star
18

Python-Text-Analysis-Fundamentals

D-Lab's 9 hour introduction to text analysis with Python. Learn how to perform bag-of-words, sentiment analysis, topic modeling, word embeddings, and more, using scikit-learn, NLTK, gensim, and spaCy in Python.
Jupyter Notebook
38
star
19

R-Data-Wrangling-Legacy

D-Lab's 6 hour introduction to data wrangling with R. Learn how to manipulate dataframes using the tidyverse in R.
R
37
star
20

python-data-from-web

API and web scraping workshops
Jupyter Notebook
35
star
21

R-Data-Visualization-Legacy

D-Lab's 3 hour introduction to data visualization with R. Learn how to create histograms, bar plots, box plots, scatter plots, compound figures, and more using ggplot2 and cowplot.
28
star
22

R-Functional-Programming

The joy and power of functional programming in R
27
star
23

python-text-analysis-legacy

Text Analysis Workshops for UC Berkeley's D-Lab
Jupyter Notebook
26
star
24

programming-fundamentals

Introduction to Programming for UC Berkeley's D-Lab
Python
23
star
25

ANN-Fundamentals

Jupyter Notebook
23
star
26

DIGHUM101-2020

Jupyter Notebook
20
star
27

Python-Text-Analysis

D-Lab's 12 hour introduction to text analysis with Python. Learn how to perform bag-of-words, sentiment analysis, topic modeling, word embeddings, and more, using scikit-learn, NLTK, Gensim, and spaCy in Python.
Jupyter Notebook
20
star
28

sql-for-r-users

SQL for R Users, Workshop
HTML
19
star
29

Python-Deep-Learning-Legacy

D-Lab's 6 hour introduction to deep learning in Python. Learn how to create and train neural networks using Tensorflow and Keras.
Jupyter Notebook
17
star
30

awesome-dlab

😎 Awesome lists about all kinds of topics and tools interesting to D-Labbers
17
star
31

advanced-data-wrangling-in-R-legacy

Advanced-data-wrangling-in-R, Workshop
HTML
15
star
32

R-Census-Data-Legacy

Workshop on fetching and mapping census data with tidycensus
HTML
14
star
33

Geospatial-Fundamentals-in-QGIS

11
star
34

regular-expressions-in-python

Jupyter Notebook
10
star
35

Qualtrics-Fundamentals

D-Lab's 3 hour introduction to Qualtrics Fundamentals. Learn how to design and manage your own surveys in Qualtrics.
10
star
36

Data-Science-Social-Justice-2022

Materials for D-Lab / UC Berkeley Graduate Division's Data Science + Social Justice summer workshop. These materials provide an introduction to Python, natural language processing, text analysis, word embeddings, and network analysis. They also include discussions on critical approaches to data science to promote social justice.
Jupyter Notebook
10
star
37

Geocoding-in-R

HTML
9
star
38

Python-Data-Wrangling

D-Lab's 3-hour workshop diving deep into Pandas. Learn how to manipulate, index, merge, group, and plot data frames using Pandas functions.
Jupyter Notebook
9
star
39

efficient-reproducible-project-management-in-R

Efficient and Reproducible Project Management in R
HTML
9
star
40

Excel-Fundamentals

D-Lab's six-hour introduction to the basics of Microsoft Excel (with support materials for Google Sheets). Learn Excel functions for handling text, math, dates, logic, and calculations; learn to create charts and pivot tables.
9
star
41

fairML

Bias and Fairness in ML workshop
Jupyter Notebook
8
star
42

Python-Web-Scraping-Legacy

D-Lab's 3 hour introduction to web scraping in Python. Learn how to use APIs and scrape data from websites using the New York Times API and BeautifulSoup in Python.
Jupyter Notebook
7
star
43

regex-intro

Shell
6
star
44

Geospatial-Fundamentals-in-R-sp

HTML
6
star
45

Leaflet-Maps-in-R

A 3-hour intensive workshop to introduce the R Leaflet package
HTML
6
star
46

javascript-viz

A D-Lab intro to JavaScript visualization using the IPython notebook.
HTML
6
star
47

DIGHUM101-2023

Practicing the Digital Humanities, UC Berkeley Summer Session 2023
Jupyter Notebook
6
star
48

LaTeX-Fundamentals

TeX
6
star
49

DIGHUM101-2021

Jupyter Notebook
5
star
50

cloud-computing-working-group

5
star
51

data-security-fundamentals

Data Security Fundamentals
HTML
5
star
52

Python-Fundamentals

D-Lab's 3-part, 6 hour introduction to Python. Learn how to create variables, distinguish data types, use methods, and work with Pandas, using Python and Jupyter.
Jupyter Notebook
4
star
53

Python-Web-APIs

D-Lab's 2 hour introduction to using web APIs in Python. Learn how to obtain data from web platforms using the New York Times API as a case study.
Jupyter Notebook
3
star
54

quick-consulting-examples

Collection of quick pandas, python, and other coding examples based on real consulting requests.
Jupyter Notebook
3
star
55

dlab-berkeley.github.io

Tech overview site showcasing D-Lab's online offerings
CSS
3
star
56

visualization-in-Excel

3
star
57

Python-Web-Scraping

D-Lab's 2 hour introduction to web scraping in Python. Learn how to scrape HTML/CSS data from websites using Requests and Beautiful Soup.
Jupyter Notebook
3
star
58

Data-Science-Social-Justice

Materials for D-Lab / UC Berkeley Graduate Division's Data Science for Social Justice summer workshop. These materials provide an introduction to Python, natural language processing, text analysis, word embeddings, and network analysis. They also include discussions on critical approaches to data science to promote social justice.
Jupyter Notebook
3
star
59

DIGHUM101-2022

Practicing the Digital Humanities, UC Berkeley Summer Session 2022
Jupyter Notebook
3
star
60

Python-Geospatial-Fundamentals

About D-Lab's 4-hour introduction to working with geospatial data in Python. Learn how to import, visualize, and analyze geospatial data in Python.
Jupyter Notebook
2
star
61

Basics-of-Excel

2
star
62

intro-maxqda

2
star
63

Python-Intermediate

D-Lab's 3-part, 6 hour workshop diving deeper into Python. Learn how to create functions, use if-statements and for-loops, and work with Pandas, using Python and Jupyter.
Jupyter Notebook
2
star
64

R-Data-Visualization

D-Lab's 2-hour introduction to data visualization with R. Learn how to create histograms, bar charts, box plots, scatter plots, and more using ggplot2.
R
2
star
65

IRB-Fundamentals

D-Lab's 3 hour introduction to the fundamentals of navigating Institutional Review Boards (IRB).
2
star
66

RStudio-Project-Management

Resources to help you start managing data science projects.
HTML
1
star
67

git-for-project-management

Using Git and GitHub for Project Management
1
star
68

R-package-development

R package development workshop
HTML
1
star
69

Git-Playground

This repository is for D-Lab workshops that require practicing with Git.
1
star
70

sas-intro

Introduction to SAS
TeX
1
star
71

R-Push-Ins

D-Lab's 4.5 hour "push-in" introduction to R, providing a brief survey of foundational R concepts and operations.
R
1
star
72

DEVP229-Spring2021

HTML
1
star
73

MAXQDA-Fundamentals

D-Lab's 2 hour introduction to MAXQDA. Learn how to conduct qualitative data analysis using MAXQDA.
1
star
74

sas-analysis

Data Analysis with SAS
SAS
1
star
75

R-Research-Design

1
star
76

ArcGIS-Online-Fundamentals

1
star
77

dlab-methods

CSS
1
star
78

Computational-Text-Analysis-2017

An introduction to Computational Text Analysis in four 2hr sessions designed to help beginners build intuition, and to interact with workflows for natural language processing, supervised, and unsupervised approaches. Created for CTAWG in 2017 by Ben Gebre-Medhin
HTML
1
star
79

Python-Data-Visualization-Pilot

D-Lab's 4-hour introduction to data visualization with Python. Learn how to create histograms, bar plots, box plots, scatter plots, compound figures, and more, using matplotlib and seaborn.
Jupyter Notebook
1
star
80

HAAS-Python-Workshop

Jupyter Notebook
1
star