You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python is a popular programming language for tasks such as data collection, cleaning, and analysis. Python can help you to create reproducible workflows to accomplish repetitive tasks more efficiently. Let's consider a few examples of folks using Python in different library settings:
26
+
Python is a popular programming language for tasks such as data collection, cleaning, and analysis. Python can help you to create reproducible workflows to accomplish repetitive tasks more efficiently.
27
27
28
-
1.**Metadata work.** Many cataloging teams use Python to migrate, transform and enrich metadata that they receive from different sources. For example, the [pymarc library](https://pypi.org/project/pymarc/) is a popular Python package for working with MARC21 records.
28
+
This lesson works with a series of CSV files of circulation data from the Chicago Public Library system to demonstrate how to use Python to clean, analyze, and visualize usage data that spans over the course of multiple years.
29
29
30
-
2.**Collection and citation analysis.** Python can automate workflows to analyze library collections. In cases where spreadsheets and OpenRefine are unable to support specific forms of analysis, Python is a more flexible and powerful tool.
30
+
::::::::::::::::::::::::::::::::::::::: challenge
31
+
## Python in Libraries
32
+
There are a lot of ways that library and information science folks use Python in their work. Go around the room and have helpers and co-teachers share how they have used Python.
31
33
32
-
3.**Assessment.** Library workers often need to collect metrics or statistics on some aspect of their work. Python can be a valuable tool to collect, clean, analyze, and visualize that data in a consistent way over time.
34
+
Learners: Can you think of other ways to use Python in libraries? Do you have hopes for how you'd like to use Python in the future?
33
35
34
-
4.**Accessing data.** Researchers often use Python to collect data (including textual data) from websites and social media platforms. Academic librarians are often well-positioned to help teach these researchers how to use Python for web scraping or querying Application Programming Interfaces (APIs) to access the data they need.
36
+
::::::::::::::: solution
35
37
36
-
5.**Analyzing data.** Python is widely used by scholars who are embarking on different forms of computational research (e.g., network analysis, natural language processing, machine learning). Library workers can leverage Python for their own research in these areas, but also take part in larger networks of academic support related to data science, computational social sciences, and/or digital humanities.
38
+
Here a few areas where you might apply Python in your work.
37
39
40
+
**Metadata work.** Many cataloging teams use Python to migrate, transform and enrich metadata that they receive from different sources. For example, the [pymarc library](https://pypi.org/project/pymarc/) is a popular Python package for working with MARC21 records.
38
41
39
-
::::::::::::::::::::::::::::::::::::: instructor
42
+
**Collection and citation analysis.** Python can automate workflows to analyze library collections. In cases where spreadsheets and OpenRefine are unable to support specific forms of analysis, Python is a more flexible and powerful tool.
40
43
41
-
Instructors: Along with the examples above, it can be helpful to ask your co-instructors and helpers to share real-world examples of how they integrate Python into their own work and why they find it useful. You can also ask learners if they have any particular Python projects in mind.
44
+
**Assessment.** Library workers often need to collect metrics or statistics on some aspect of their work. Python can be a valuable tool to collect, clean, analyze, and visualize that data in a consistent way over time.
42
45
43
-
:::::::::::::::::::::::::::::::::::::::::::::::::
46
+
**Accessing data.** Researchers often use Python to collect data (including textual data) from websites and social media platforms. Academic librarians are often well-positioned to help teach these researchers how to use Python for web scraping or querying Application Programming Interfaces (APIs) to access the data they need.
47
+
48
+
**Analyzing data.** Python is widely used by scholars who are embarking on different forms of computational research (e.g., network analysis, natural language processing, machine learning). Library workers can leverage Python for their own research in these areas, but also take part in larger networks of academic support related to data science, computational social sciences, and/or digital humanities.
@@ -152,35 +159,45 @@ While Python runs both calculations Juypter will only display the output from th
152
159
3
153
160
```
154
161
155
-
::::::::::::::::::::::::::::::::::::::::: callout
156
162
### Editing the notebook
157
163
158
164
You can use the icons at the top of your notebook to edit the cells in your Notebook:
165
+
159
166
- The `+` icon adds a new cell below the selected cell.
160
-
The scissors icon will delete the current cell.
167
+
- The scissors icon will delete the current cell.
161
168
162
169
You can move cells around in your notebook by hovering over the left-hand margin of a cell until your cursor changes into a four-pointed arrow, and then dragging and dropping the cell where you want it.
Instructors: Since the lesson is focused on Python we don't include any Markdown examples here. If you want to teach Markdown, note that it will slow down the lesson.
176
+
177
+
:::::::::::::::::::::::::::::::::::::::::::::::::
178
+
167
179
You can add text to a Juypter notebook by selecting a cell, and changing the dropdown above the notebook from `Code` to `Markdown`. Markdown is a lightweight language for formatting text. This feature allows you to annotate your code, add headers, and write documentation to help explain the code. While we won't cover Markdown in this lesson, there are many helpful online guides out there:
168
180
-[Markdown for Jupyter Cheatsheet (IBM)](https://www.ibm.com/docs/en/watson-studio-local/1.2.3?topic=notebooks-markdown-jupyter-cheatsheet)
{alt='screenshot of the Jupyter notebook dropdown to change a cell to Markdown'}
172
184
185
+
You can also use "hotkeys"" to change Jupyter cells from Code to Markdown and back:
186
+
187
+
- Click on the code cell that you want to convert to a Markdown cell.
188
+
- Press the <kbd>Esc</kbd> key to enter command mode.
189
+
- Press the <kbd>M</kbd> key to convert the cell to Markdown.
190
+
- Press the <kbd>y</kbd> key to convert the cell back to Code.
0 commit comments