PRO
Sarravanabavan
asked

Expert
Abhay Jajodia answered
Hi Sarravanabavan,
Good question — and it depends on the context.
In programming, indexing usually starts at 0. So in Python, for example:
matrix[0][0] # first row, first column
But in mathematics, people usually count rows and columns starting from 1. So what programming calls "column 0", math might refer to as "column 1".
If you're learning from a math-based explanation or a textbook, it's normal to see columns numbered from 1. But if you're working with actual code, like Python or NumPy, indexing starts from 0.
So you're not doing anything wrong — it's just two different conventions.
If you have more questions, I am here to help.
Python
This question was asked as part of the Python Numpy for Data Science course.
Our Experts
Sudip BhandariHead of Growth/Marketing
Apekchhya ShresthaSenior Product Manager
Kelish RaiTechnical Content Writer
Abhilekh GautamSystem Engineer
Palistha SinghTechnical Content Writer
Sarthak BaralSenior Content Editor
Saujanya Poudel
Abhay Jajodia
Nisha SharmaTechnical Content Writer
Udayan ShakyaTechnical Content Writer