# Python for commerce students, from a former bio kid

> I was the resource person for a Python for financial analysis workshop for B.Com students. A few years ago I was the non-CS kid in a CS class. Why I think commerce students should learn Python, and a free beginner path from spreadsheet to pandas.

- Author: Rahul Dhileep Kumar (https://www.rahuldk.in/)
- Published: 2026-10-18
- Reading time: 6 min read
- Tags: student life, ai
- Canonical: https://www.rahuldk.in/blog/teaching-python-to-commerce-students

![A green line chart of a share price on a laptop screen, with time and price axes](https://www.rahuldk.in/posts/teaching-python-to-commerce-students/cover.webp)

On 18 September 2026 I was the resource person for a workshop called "Basic Python for Financial Analysis".
The audience was B.Com (Hons.) students at Ethiraj College for Women.

A few years ago I was a bio-maths student.
Now I was the one at the front, talking about Python.
Life is strange like that.

This post isn't a recap of the workshop.
It's about why I think Python for commerce students is a good idea, and what a beginner path could look like.
All of it is about analysis skills.
None of it is investing advice. Please don't buy anything because of a moving average you calculated on a Tuesday.

![A green line chart of a share price on a laptop screen, with time and price axes](https://www.rahuldk.in/posts/teaching-python-to-commerce-students/cover.webp)

*Photo: [Markus Winkler](https://unsplash.com/@markuswinkler) on [Unsplash](https://unsplash.com/photos/stock-market-chart-displayed-on-laptop-screen-IrRbSND5EUc)*

## The other side of the room

In class 12 I did biology and maths.
Then I switched to computer science.

In a class full of CS students, I was the non-CS kid.
I felt behind. Properly behind.
So in my first month of college I taught myself more than 12 programming languages.
freeCodeCamp was my biggest teacher, and I'm still grateful to it.
(The long version is in [switching from biology to computer science](https://www.rahuldk.in/blog/bio-maths-to-computer-science).)

What I learned from that month is simple.
The gap between "CS student" and "not a CS student" is smaller than it looks from the outside.
Most CS students know the basics: some Python, general IT.
The class 11 and 12 CS syllabus can be covered in a month or two.

So when someone says "I'm from commerce, coding isn't for me", I don't really buy it.
I was from biology. It wasn't for me either. Until it was.

## Why Python, if you already have Excel

Excel is great. I'm not here to start a fight with Excel.
But spreadsheets get painful when the data gets big, or the same steps repeat every month.

CPA Australia's magazine INTHEBLACK ran a piece on [why accountants should learn Python](https://intheblack.cpaaustralia.com.au/technical-skills/why-accountants-should-learn-python).
It says "Python is more flexible than Excel, and it offers greater efficiency, scalability and auditability."
It also says Python lets accountants "automate tasks, especially those that are repetitive and involve clear logical steps."
And that "digital and data skills are now considered a core competency."

That last line is the one I'd underline for a B.Com student.
You're not trying to become a software engineer.
You're trying to be the person in the finance team who doesn't dread a 50,000-row file.

The word I like in that quote is "auditability".
A formula buried in cell K482 is hard to check.
A script you can read top to bottom is easier to check, rerun and hand to someone else.

The [official Python tutorial](https://docs.python.org/3/tutorial/index.html) calls Python "an easy to learn, powerful programming language".
It's also free: the interpreter and standard library are "freely available" for all major platforms.
For students, free matters. It certainly mattered to me.

## You don't even need to install anything

The first hurdle for beginners is usually setup, not code.
Installing things, paths, versions, the usual suffering.

[Google Colab](https://research.google.com/colaboratory/faq.html) skips that.
Its FAQ describes it as "a hosted Jupyter Notebook service that requires no setup to use", and says "Colab is free of charge to use."
You open a browser, sign in, and type code.
The FAQ is also honest that free resources are "not guaranteed and not unlimited", which is fine for a beginner reading a CSV.

![A laptop showing a Google Colab notebook that has just printed Hello World](https://www.rahuldk.in/posts/teaching-python-to-commerce-students/colab-hello-world.webp)

*Photo: [Zach Graves](https://unsplash.com/@zgraves) on [Unsplash](https://unsplash.com/photos/a-screen-shot-of-a-computer-wtpTL_SzmhM)*

## A beginner path, from spreadsheet to pandas

This is my opinion of a sensible order, not a syllabus.
Each step is small. That's the point.

1. **Think in tables first.** You already do this in Excel. Rows are records, columns are fields. That habit carries straight over.
2. **Learn just enough Python.** Variables, lists, loops, functions. A week of evenings, not a semester.
3. **Meet pandas.** pandas is the library that gives Python spreadsheet-like tables. Its own [10 minutes to pandas](https://pandas.pydata.org/docs/user_guide/10min.html) guide is "a short introduction to pandas, geared mainly for new users". It covers viewing, selecting, grouping, pivot tables, time series, and reading and writing CSV and Excel files.
4. **Read a CSV of prices.** Download a price history as a CSV and load it. Look at it. Check the dates came in as dates.
5. **Calculate something simple.** Daily returns and a moving average are a good first exercise. Not because they predict anything, but because they make you handle dates, gaps and windows.

Here is what step 5 can look like:

```python
import pandas as pd

prices = pd.read_csv("prices.csv", parse_dates=["Date"], index_col="Date")
close = prices["Close"]

daily_return = close.pct_change()             # 0.012 means 1.2%
moving_avg = close.rolling(window=20).mean()  # 20-day average

print(daily_return.describe())
print(moving_avg.tail())
```

It assumes a CSV with a `Date` column and a `Close` column.
[`pct_change`](https://pandas.pydata.org/docs/reference/api/pandas.Series.pct_change.html) is the "fractional change between the current and a prior element", so the first row is empty because there's nothing before it.
[`rolling`](https://pandas.pydata.org/docs/user_guide/window.html) looks back "the length of the window from the current observation".
With a 20-day window, the first 19 averages are empty too.
Seeing those blanks and understanding why they're there is half the lesson.

One small gotcha: in current pandas, `pct_change` no longer fills missing values for you.
The docs suggest calling `ffill()` first if your data has gaps.
That's exactly the kind of detail you only learn by running the code and squinting at the output.

## Free resources I'd point people to

I won't pay for something I can get free, and I won't ask students to either.

- **[The Python tutorial](https://docs.python.org/3/tutorial/index.html).** One honest warning: it says it's "designed for programmers that are new to the Python language, not beginners who are new to programming". Use it as a reference once you've started somewhere gentler.
- **[10 minutes to pandas](https://pandas.pydata.org/docs/user_guide/10min.html).** It will take longer than ten minutes. It's still the best map of what pandas can do.
- **freeCodeCamp's [Learn Data Analysis with Python](https://www.freecodecamp.org/news/learn-data-analysis-with-python-course/).** A free four-hour course by Santiago Basulto. It covers reading data "from multiple sources (CSVs, SQL, Excel)", cleaning it with NumPy and pandas, and visualising it with Matplotlib and Seaborn.
- **[Google Colab](https://research.google.com/colaboratory/faq.html).** To run all of the above without installing anything.

freeCodeCamp was my biggest teacher. Biased? Yes. Wrong? I don't think so.

## Being at the front of the room

Same month, same college:
I was also the Chief Guest at the AURORA '26 valedictory ceremony at Ethiraj.
Which is a lot of stage time for someone who used to feel like the odd one out in his own class.

If there's one thing I'd want a commerce student to take away, it's this.
You're not late. You're not in the wrong stream.
You're one CSV file away from starting.

## FAQ

### Do commerce students need to learn coding?

Nobody needs to. But data skills are increasingly expected in accounting and finance roles, and Python is a friendly way in.

### Is this financial advice?

No. Returns and moving averages here are exercises in handling data, not signals to buy or sell anything.

### What's the fastest way to start?

Open Google Colab, load a small CSV with pandas, and print the first few rows. Then make it do one useful thing.

## Sources

- [INTHEBLACK (CPA Australia): Why accountants should learn Python](https://intheblack.cpaaustralia.com.au/technical-skills/why-accountants-should-learn-python)
- [Python documentation: The Python Tutorial](https://docs.python.org/3/tutorial/index.html)
- [pandas: 10 minutes to pandas](https://pandas.pydata.org/docs/user_guide/10min.html)
- [pandas: Series.pct_change](https://pandas.pydata.org/docs/reference/api/pandas.Series.pct_change.html)
- [pandas: Windowing operations](https://pandas.pydata.org/docs/user_guide/window.html)
- [Google Colab FAQ](https://research.google.com/colaboratory/faq.html)
- [freeCodeCamp: Learn Data Analysis with Python](https://www.freecodecamp.org/news/learn-data-analysis-with-python-course/)

## What next

The full story of the switch: [switching from biology to computer science, with zero plan](https://www.rahuldk.in/blog/bio-maths-to-computer-science).
And how we got through the early days on free AI trials: [dozens of email accounts and zero shame](https://www.rahuldk.in/blog/dozens-of-email-accounts-and-zero-shame).

---

Written by Rahul Dhileep Kumar, product engineer and founder (Track My Academy, TrackMy Tech). More posts: https://www.rahuldk.in/blog
