Lecture 3-15 April
Lecture 3-15 April
Topics-
2-Dimensions of a dataframe
What is it?
Every column in a DataFrame has a data type (like numbers, text, or decimals). Sometimes, you need to
change or set the type to make sure Python understands your data correctly—like telling it "this column is
numbers, not text."
Real-life Example:
In your pet store, you have a list of pets and their prices. The price might look like a number (e.g., 50), but
Python might think it’s text ("50"). You fix it to make sure it’s treated as a number so you can add prices later.
Python Example:
Let’s go through the code line by line so you fully understand what's happening: