June 04, 2025

Python, Continued, and Data Check-ins

Pre-work:

Readings

  • Grimmer, Justin, et al. Text as Data: A New Framework for Machine Learning and the Social Sciences. Princeton University Press, 2022.
    • Chapters 2 through 5. Files available via Box (email Iliana if you can’t find them!).

Practice

  • Open up a new notebook in Jupyter Lab. Then, go to the Python Basics lesson of Data Analysis and Visualization with Python for Social Scientists alpha from Data Carpentry. Read the content and use the notebook to create cells and write programs as guided by the lesson.

During the Session

Data and Python check-ins

We will briefly check in regarding how the Python homework went. Then, Iliana will go around the room and check in with everyone to discuss strategies for building or preparing your corpora.

In the meantime, begin reviewing the following lessons from Walsh (2021): “Python String Methods” and “Files and Character Encoding”.

If you notice any strange errors, it might have to do with the version of Python you’re using. Since the Walsh (2021) textbook was written, there have been some updates to Python. See also the Python documentation: “What’s New in Python 3.13.

Guiding questions as we consider methods tomorrow and into next week

  • What is the underlying argument about “where meaning lies” with this text analysis method? How might this argument speak to your project interests?

After the session:

  1. Reflection post.
  2. Finish reviewing the Python lessons from Walsh.
  3. Pre-session work for tomorrow.