Module 2: Introduction to low-code Python programming


Lesson 2.2: Python and AI-aided data analysis

AI-aided content analysis of sustainability communication

nils.holmberg@iko.lu.se

Python for Social Science Data Analysis

  • Overview of data analysis types: descriptive, inferential, exploratory
  • Emphasis on quantitative methods used in social sciences
  • Introduction to computational content analysis (text/image)
  • Benefits of using Python for flexible, scalable analysis
  • Common libraries: pandas, statsmodels, matplotlib, scikit-learn

AI-Aided Quantitative Analysis with Python

  • Use large language models (LLMs) to generate statistical code
  • Query data directly using natural language prompts
  • Automate hypothesis testing and model fitting
  • Reduce entry barrier for non-programmers
  • Balance between manual control and AI guidance

AI-Aided Computational Content Analysis

  • Apply LLMs for text classification, summarization, and topic modeling
  • Use image models (e.g., CLIP, ViT) for analyzing visual content
  • Combine text and visual features for rich content analysis
  • Automate entity recognition and theme detection
  • Use AI to scale analysis of large corpora

Low-Code Data Analysis with Tables

  • Load and view datasets using pandas DataFrames
  • Perform filtering, grouping, and summary stats with minimal code
  • Contrast high-code scripts vs. low-code AI-assisted workflows
  • Use AI tools to generate and interpret table outputs
  • Example tools: pandasgui, datatable, ChatGPT + CSV

Data Transformations with AI Assistance

  • Select relevant variables using prompts or code
  • Filter observations based on conditions (e.g., time, value ranges)
  • Aggregate data for summaries (e.g., mean by group)
  • Compare traditional pandas syntax vs. AI-assisted queries
  • Learn transformation logic through interactive AI feedback

Low-Code Data Analysis with Graphs

  • Create basic visualizations (e.g., bar, line, histogram)
  • Understand univariate (one variable) vs. bivariate (two variables) plots
  • Use AI to suggest and generate appropriate plot types
  • Example libraries: matplotlib, seaborn, plotnine
  • Visualize data trends and relationships with minimal setup

Multivariate and Interactive Graphs

  • Visualize relationships between three or more variables
  • Use scatter matrices, heatmaps, or bubble charts
  • Add interactivity with plotly, altair, or holoviews
  • Use AI to refine visual layouts and variable selections
  • Enable dynamic exploration of patterns in large datasets