Importing of dataset as a list

Hi All

I would like to clarify something which I don’t quite understand. I’m working on Python Data Analysis Basics and on the first screen the code to import the relevant file was provided. I noticed that the file was imported as a list and I don’t fully understand why that is necessary.

Please can you explain it to me?

Link to page: Learn data science with Python and R projects

Best
JK

The data is in a CSV file, where there are multiple rows and columns. A list serves as a good container to store that data in a Python program. The data will be stored inside a list of lists, where each list would be a row, and each column value for that row will be stored in that list.

There are other and better ways to store and work with data in Python. But from an introductory/beginner standpoint and for a small amount of data, this works quite well. As you go through the content you will learn about alternatives as well.

Thanks @the_doctor for the feedback.

Apologies for the tardy response.

None needed :slight_smile: