Pythonic Grading that Rewards Sharing
PyConSG Education Summit · 11 Aug 2025 · SUTD, Singapore Anand S · LLM Psychologist · Straive Video · Blog · Slides · Transcript
Project 2 Tools in Data Science, BS Data Science, IIT Madras
Write a Python script that uses an LLM to analyze, visualize, and narrate a story from a dataset. Convince an LLM that your script and output are of high quality. Running uv run autolysis.py DATA.csv must create a README.md with automated analysis as a story + data visualizations.
Running uv run autolysis.py DATA.csv must create a README.md with automated analysis as a story + data visualizations.
uv run autolysis.py DATA.csv
README.md
Rubric 17/27: Code sends only carefully chosen analysis to the LLM?
The code focuses on selective data analysis required to prepare a report but doesn't have a filtering mechanism to only present certain metrics to the AI. The code only processes relevant analyses by summarizing key findings (missing values, statistics, etc.) before sending it to the LLM, thereby avoiding unnecessary data.
8 bonus marks for code diversity. You're welcome to copy code and learn from each other. But we encourage diversity too. We evaluate code similarity. Unique responses get bonus marks. If your response is similar to priors, you don't get these marks.
8 bonus marks for code diversity.
You're welcome to copy code and learn from each other. But we encourage diversity too.
We evaluate code similarity. Unique responses get bonus marks.
If your response is similar to priors, you don't get these marks.
Evaluation code: similarity.py
similarity.py
Who you copy from matters! Copy late for more options.
Original | Copy: used API keys from the environment.
# /// script # requires-python = ">=3.11" # dependencies = [ # "pandas", # "seaborn", # "matplotlib", # ... # "scikit-learn", # ] # ///
# /// script # requires-python = ">=3.12" # dependencies = [ # "pandas", # "seaborn", # "matplotlib", # ... # "scikit-learn", # "python-dotenv" # ] # ///
Original | Copy: hard-coded the API key.
import os import sys ... from sklearn.cluster import KMeans from sklearn.impute import SimpleImputer AIPROXY_TOKEN = os.getenv("AIPROXY_TOKEN")
import os import sys ... from sklearn.cluster import KMeans from sklearn.impute import SimpleImputer AIPROXY_TOKEN = os.getenv("eyJhbGciOi...")
Don’t change their code unless you KNOW what you’re doing. Spend more time testing than changing.
Code with <50% Jaccard similarity (like below) are standalone.
f"You are a data analyst. Given the following dataset information, provide an analysis plan and suggest useful techniques:\n\n" f"Columns: {list(df.columns)}\n" f"Data Types: {df.dtypes.to_dict()}\n"
f"You are a data analyst. Provide a detailed narrative based on the following data analysis results for the file '{file_path.name}':\n\n" f"Column Names : {list(df.keys())}\n\n" f"Summary Stats: {analysis['summary']}"
About 50% of the submissions were standalone! They didn't copy despite encouragement.
Students who let others copy from them got feedback and improved. They scored the most.
PyConSG Education Summit · 11 Aug 2025 · SUTD, Singapore Anand S · LLM Psychologist · Straive Blog · Slides · Transcript