Using ChatGPT to write Python Code to Analyze Chemical Data in Google Colab

Опубликовано: 19 Март 2026
на канале: Gianmarc Grazioli
279
13

In this tutorial, I demonstrate how to use a publicly available Kaggle dataset to analyze chemical melting point data using ChatGPT and Python inside Google Colab. It's all free, and you don't need to install any software on your computer! The video authentically walks through downloading the dataset, loading it into a pandas DataFrame, and generating a correlation matrix and regression plots. You’ll see how ChatGPT can automatically write and refine Jupyter notebooks for real data analysis. I also introduce RDKit for computing molecular descriptors such as molecular weight and hydrogen bond donors. This video is great for students learning data science, chemistry, and AI-assisted coding.

This video is an authentic, unedited walkthrough of what it’s really like to work with ChatGPT in this way. I kept the full process intact—including moments of trial and error—so you can see a genuine example of how to navigate small issues, interpret feedback, and iterate when using AI for real data analysis. The goal is to show the full experience, not just the polished result, so you’ll know what to expect and what to watch out for in your own work.


0:00 – Introduction and overview
0:10 – About the Kaggle melting point dataset
0:37 – What SMILES strings are and why they matter
1:09 – Downloading the dataset from Kaggle
1:29 – Choosing between CSV and Excel formats
2:06 – Introduction to pandas and data frames
2:32 – Uploading and organizing data in Google Drive
3:05 – Connecting Google Colab with your Drive
3:39 – Writing a prompt for ChatGPT to generate code
4:54 – Uploading your dataset into ChatGPT
6:04 – How ChatGPT plans a Jupyter notebook
7:28 – Understanding correlation matrix and regression setup
8:35 – Opening the notebook in Google Colab
9:05 – Code cells vs. text cells in a notebook
10:00 – Uploading files into Colab’s working directory
11:17 – Running the notebook and checking for errors
12:03 – Reviewing the imported Python libraries
13:26 – Understanding random seeds and reproducibility
14:10 – Reading data into pandas and cleaning it
15:07 – Using df.info and df.describe for quick data insights
16:18 – Keeping only numeric columns for correlation
17:52 – Interpreting the correlation matrix
19:28 – How ChatGPT identifies key columns automatically
21:02 – Creating a heatmap with matplotlib
22:33 – Why correlation is weak without molecular descriptors
23:29 – Generating new molecular descriptors from SMILES
24:50 – Asking ChatGPT to add RDKit descriptor analysis
26:09 – Fixing missing library errors in Colab
31:02 – Installing RDKit manually in a new cell
32:27 – Checking that installation succeeded
33:34 – Computing molecular descriptors (H-bond donors, weight, etc.)
35:47 – Filtering valid molecules and handling missing data
38:11 – Combining descriptors with melting point data
38:46 – Fixing column name mismatches
39:17 – Generating the new correlation heatmap
39:55 – Interpreting correlations between molecular features
40:31 – Final summary: what we learned and next steps