This course introduces social scientists to the power of programming, focusing on using Python to enhance social science research. Learn to write code that aids data collection, analysis, and visualization, applying it to real-world social science problems.

Programming with Python for Social Scientists

Recommended experience
Recommended experience
What you'll learn
Learn how to structure Python code to support social science research.
Gain proficiency in using social media APIs and web scraping for data collection.
Master the techniques for decoding and encoding data in various formats like CSV, JSON, and XML.
Details to know

Add to your LinkedIn profile
June 2026
16 assignments
See how employees at top companies are mastering in-demand skills

There are 16 modules in this course
This module introduces the unique intersection of Python 3 programming and social science research, highlighting why Python is particularly suited for social scientists. Learners will explore the motivations behind this course, the limitations of existing resources, and the foundational concepts that will guide their programming journey. By the end, participants will understand the course's aims and how Python can empower their research workflows.
What's included
1 video9 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
9 readings•Total 42 minutes
- Introduction•7 minutes
- Who Is This Course for? Why This Course?•5 minutes
- Why not digital-methods-for-social-science literature?•4 minutes
- Why not existing computer-programming-for-beginners literature?•3 minutes
- Why Python? Why Python 3?•6 minutes
- What can Python 3 do?•3 minutes
- "Grilled Cheese Programming": A Methodology, A Manifesto•6 minutes
- Aims, Scope, Outcomes and Overview of the Course•4 minutes
- Overview•4 minutes
1 assignment•Total 16 minutes
- Foundations of Digital Methods and Programming for Social Scientists•16 minutes
This module introduces the foundational concepts of programming within the context of social science research, emphasizing the interplay between technical tools and methodological rigor. Learners will explore how digital data analysis requires sensitivity, critical thinking, and interdisciplinary approaches. The module also highlights the importance of reflexivity and workflow design in conducting robust digital research.
What's included
1 video8 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
8 readings•Total 44 minutes
- Introduction•15 minutes
- The Research Process as a Socio-technical Assemblage•3 minutes
- Definitions: "Scientism" and "Bureaucracy": Two Related Concerns•5 minutes
- The importance of methodology•4 minutes
- A more sensitive approach to digital data•3 minutes
- Working Interdisciplinarily•4 minutes
- Thinking in Script/Developmental Workflows•7 minutes
- Developmental workflows•3 minutes
1 assignment•Total 16 minutes
- Foundations of Programming in Social Science•16 minutes
This module explores how programming intersects with social justice, emphasizing ethical coding practices and the societal impact of technology. Learners will investigate real-world examples of coding for social change and consider how Python can be used to address systemic biases. The module also introduces foundational ethical considerations for integrating programming into social science research.
What's included
1 video5 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
5 readings•Total 24 minutes
- Introduction•4 minutes
- Coding Social Injustice and Justice into the World•7 minutes
- Coding for social justice•4 minutes
- Ethical Considerations of Programming-as-Social-Science•4 minutes
- What Can/Should We Do with Python?•5 minutes
1 assignment•Total 16 minutes
- Programming as a Lens for Social and Ethical Analysis•16 minutes
This module introduces the essentials for beginning Python programming, including installing Python, navigating the Python shell, and using comments to write clear, maintainable code. Learners will gain hands-on experience setting up their coding environment and understanding foundational coding practices.
What's included
1 video3 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
3 readings•Total 14 minutes
- Introduction•4 minutes
- The Python shell•6 minutes
- Commenting•4 minutes
1 assignment•Total 16 minutes
- Getting Started with Python Development•16 minutes
This module introduces foundational Python programming concepts, including variable types, mathematical operations, and conditional logic. Learners will practice manipulating data, performing calculations, and controlling program flow using IF/ELIF/ELSE statements. By the end, you'll be able to write basic Python scripts that make decisions based on logical conditions.
What's included
1 video4 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
4 readings•Total 45 minutes
- Introduction•18 minutes
- Mathematical Operations and Comparison/Equality•9 minutes
- Flow Control (and Whitespace)•9 minutes
- The logical order of code and the order of logic in code•9 minutes
1 assignment•Total 16 minutes
- Core Programming Fundamentals•16 minutes
This module introduces Python's core data structures—lists, dictionaries, tuples, and strings—emphasizing their methods and practical uses in organizing and manipulating data. Learners will gain hands-on experience with common operations, slicing, and formatting techniques to efficiently manage collections and text in Python programs.
What's included
1 video10 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
10 readings•Total 62 minutes
- Introduction•4 minutes
- Working with lists•6 minutes
- Working with num_list•10 minutes
- Lists and list methods in action•6 minutes
- Dictionaries and Dictionary Methods•5 minutes
- The dictionary of YOU•11 minutes
- Dictionaries and dictionary methods in action•6 minutes
- Slicing with ranges in Python•4 minutes
- Formatting a string•6 minutes
- Strings and string methods in action•4 minutes
1 assignment•Total 16 minutes
- Mastering Data Structures in Python•16 minutes
This module introduces key Python programming concepts such as functions, variable scope, loops, and list comprehensions. Learners will practice writing and applying these constructs to automate tasks and manipulate data efficiently. Through hands-on exercises, you'll gain practical skills for building more robust and reusable code.
What's included
1 video7 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
7 readings•Total 37 minutes
- Introduction•3 minutes
- Working with functions•6 minutes
- Scope: global and local code•5 minutes
- Functions in action•7 minutes
- Loops and List Comprehension•7 minutes
- Working with list comprehensions•6 minutes
- Loops in action•3 minutes
1 assignment•Total 16 minutes
- Mastering Function Design and Data Handling•16 minutes
This module introduces the fundamentals of creating and managing custom classes in Python. Learners will discover how to construct classes, instantiate objects, and utilize class-based structures for effective data management. Practical examples will help solidify understanding of object-oriented programming concepts.
What's included
1 video3 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
3 readings•Total 28 minutes
- Introduction•4 minutes
- Class construction•5 minutes
- Class instances•19 minutes
1 assignment•Total 16 minutes
- Exploring Classes and Object Design•16 minutes
This module introduces practical Python skills such as installing and importing modules, managing code execution timing, and creating user-friendly script interfaces. Learners will also explore best practices for documenting code and scheduling automated tasks. By the end, you'll be able to enhance your Python scripts for greater efficiency and usability.
What's included
1 video10 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
10 readings•Total 54 minutes
- Introduction•4 minutes
- Navigating to the Python directory with Command Prompt•6 minutes
- Using pip3 to install modules•4 minutes
- Importing Modules•8 minutes
- Timing Your Code•4 minutes
- Using date and time in your code•3 minutes
- Scheduling tasks•12 minutes
- Creating Script Interfaces with Inputs•6 minutes
- Why bother?•4 minutes
- "Documenting code" is not just about comments•3 minutes
1 assignment•Total 16 minutes
- Essential Concepts in Python Scripting•16 minutes
This module guides learners through the structured planning and design of research projects that integrate programming within social science contexts. You will explore practical frameworks, iterative development strategies, and adaptive planning techniques to effectively manage and execute coding-based research. Emphasis is placed on both theoretical considerations and real-world challenges encountered during project implementation.
What's included
1 video3 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
3 readings•Total 21 minutes
- Introduction•11 minutes
- Practicalities•7 minutes
- Planning as a live process•3 minutes
1 assignment•Total 16 minutes
- Designing Research with Programming•16 minutes
This module introduces the fundamentals of handling text files in Python, including reading, writing, and managing files across directories. Learners will gain practical skills in manipulating file data and understanding string literals for effective data processing. Real-world applications and project ideas are also discussed to contextualize these techniques.
What's included
1 video6 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
6 readings•Total 23 minutes
- Introduction•3 minutes
- Opening, writing information to, and closing a text file•5 minutes
- Reading text into Python from a text file•4 minutes
- String literals•4 minutes
- Working with files in directories•5 minutes
- Some Possible Applications/Projects•2 minutes
1 assignment•Total 16 minutes
- Fundamentals of Text File Operations in Python•16 minutes
This module guides learners through the process of authenticating and connecting to the Twitter API using Python, retrieving social media data, and managing rate limits for scalable data collection. Learners will gain hands-on experience in setting up developer credentials, writing scripts to access and store Twitter data, and understanding the importance of API documentation. By the end, participants will be equipped to build and extend their own social media data collection tools.
What's included
1 video7 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
7 readings•Total 42 minutes
- Introduction•4 minutes
- Getting Your Authentication Credentials•7 minutes
- Setting up a Twitter application•4 minutes
- Show Me the Code!•7 minutes
- Reading from Twitter•7 minutes
- Taking it further (building bigger scripts, and rate limiting)•8 minutes
- Documentation – it's important!•5 minutes
1 assignment•Total 16 minutes
- Ethical and Technical Aspects of Social Media API Usage•16 minutes
This module introduces techniques for retrieving, decoding, and encoding data in widely-used formats such as CSV, JSON, and XML. Learners will practice accessing datasets from the web, manipulating them with Python, and extracting meaningful insights relevant to social science research. By the end, you'll be equipped to handle diverse data sources and formats for your own projects.
What's included
1 video10 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
10 readings•Total 47 minutes
- Introduction•2 minutes
- Show Me the Code! Reading from the Web•5 minutes
- Reading from the web with `requests`•7 minutes
- Grabbing, reading and writing CSV data•4 minutes
- Working with CSV data•4 minutes
- Show Me the Code! JSON Data•5 minutes
- Grabbing, reading and writing JSON data•7 minutes
- Show Me the Code! XML Data•5 minutes
- Working with XML data•5 minutes
- Some Possible Applications/Projects•3 minutes
1 assignment•Total 16 minutes
- Data Formats and Their Handling•16 minutes
This module introduces learners to the fundamentals of web scraping using Python, focusing on inspecting HTML, extracting data with BeautifulSoup, and cleaning the collected information. Through practical examples, students will gain hands-on experience in retrieving and preparing real-world web data for analysis.
What's included
1 video6 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
6 readings•Total 23 minutes
- Introduction•5 minutes
- Exploring a real example of HTML•4 minutes
- Show Me the Code! Web Scraping with BeautifulSoup•4 minutes
- Cleaning up web-scraped data•3 minutes
- Some further reflections•4 minutes
- Some Possible Applications/Projects•3 minutes
1 assignment•Total 16 minutes
- Web Scraping and Data Handling Fundamentals•16 minutes
This module introduces learners to data manipulation with Pandas and data visualization using Matplotlib in Python. You will practice creating and formatting visual representations of complex datasets, and reflect on the broader implications of how data is presented. By the end, you'll be able to generate, customize, and save insightful visualizations for real-world data analysis.
What's included
1 video8 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
8 readings•Total 61 minutes
- Introduction•12 minutes
- Pandas dataframes•14 minutes
- Show Me the Code! Matplotlib•7 minutes
- Bar charts in Matplotlib•6 minutes
- Taking visualisations further – formatting•9 minutes
- Taking visualisations further – saving•6 minutes
- Data visualisation as a sociological activity•4 minutes
- Some Possible Applications/Projects•3 minutes
1 assignment•Total 16 minutes
- Exploring Data Visualization and Pandas Fundamentals•16 minutes
This module wraps up your journey by focusing on best practices for sharing code, documenting your work, and communicating complex programming concepts to diverse audiences. You'll learn how to present your programming projects effectively within the social sciences and foster collaboration through clear documentation and writing.
What's included
1 video3 readings1 assignment
1 video•Total 1 minute
- Overview•1 minute
3 readings•Total 22 minutes
- Introduction•4 minutes
- A Few Final Points•8 minutes
- Writing about your code•10 minutes
1 assignment•Total 16 minutes
- Programming as a Social Science Lens•16 minutes
Instructor

Offered by
Why people choose Coursera for their career

Felipe M.

Jennifer J.

Larry W.

Chaitanya A.
Frequently asked questions
To access the course materials, assignments and to earn a Certificate, you will need to purchase the Certificate experience when you enroll in a course. You can try a Free Trial instead, or apply for Financial Aid. The course may offer 'Full Course, No Certificate' instead. This option lets you see all course materials, submit required assessments, and get a final grade. This also means that you will not be able to purchase a Certificate experience.
When you purchase a Certificate you get access to all course materials, including graded assignments. Upon completing the course, your electronic Certificate will be added to your Accomplishments page - from there, you can print your Certificate or add it to your LinkedIn profile.
Yes. In select learning programs, you can apply for financial aid or a scholarship if you can’t afford the enrollment fee. If fin aid or scholarship is available for your learning program selection, you’ll find a link to apply on the description page.
More questions
Financial aid available,



