That is the title of the book that Josh Cutler and I wrote. The book is part of Springer’s Textbooks on Political Analysis series. It is intended for graduate students in political and social science departments who want to collect and analyze data using Python.

We have set up a site for the book at As we discover errors we will correct them there. If you find a mistake in the book please contact us by email or on Twitter (@mcdickenson, @josh_cutler).

Our book started as a course in the Department of Political Science at Duke University. I also taught a similar short course at Washington University in St. Louis in the summer of 2014. Students in both courses provided very helpful feedback.

The contents of the book are:

Book Cover

  1. Getting Started with Python
  2. Building Software
  3. Object-Oriented Programming
  4. Introduction to Algorithms
  5. Introduction to Data Structures
  6. Input, Output, and the Web
  7. Application Programming Interfaces
  8. Databases
  9. NoSQL Databases
  10. Introduction to Machine Learning with Python
  11. Linear Programming
  12. Practical Programming
  13. Case Study: Image Processing
  14. Case Study: Natural Language Processing
  15. Conclusion

Each chapter includes example code, suggested homework assignments (with solutions), and material for practical lab sessions. Data for the exercises is available at

Working on this book with Josh was a great experience. We are grateful to our series editor Jamie Monogan, our Springer editor Lorraine Klimowich, and manuscript reviewers including Florian Hollenbach and Shahryar Minhas. We hope that this book contributes to the advancement of political and social research, and to the use of computational skills in those fields.