Posted on 25th July 2024|15 views
How to Read a CSV into the list of lists in python?
Posted on 25th July 2024| views
Let us assume you have a CSV file of employee.csv, and the contents are like
Id name department
31 raj sales
32 jai business development
33 veer content writing
Import CSV to list of lists
from csv import reader
with open('employee.csv', 'r') as read_obj:
csv_reader = reader(read_obj)
list_rows = list(csv_reader)
print(list_rows)