lf_csv: read csv file row wise

This commit is contained in:
Nikita Yadav
2022-05-02 17:50:37 +05:30
committed by shivam
parent 2672e08bcf
commit 393f579214

View File

@@ -21,6 +21,7 @@ INCLUDE_IN_README
import pandas as pd
from pandas import *
from csv import reader
class lf_csv:
def __init__(self,
@@ -53,6 +54,18 @@ class lf_csv:
print("value of column", value)
return value
def read_csv_row(self, file_name):
lst = []
with open(str(file_name), 'r') as read_obj:
# pass the file object to reader() to get the reader object
csv_reader = reader(read_obj)
# Iterate over each row in the csv using reader object
for row in csv_reader:
# row variable is a list that represents a row in csv
print(row)
lst .append(row)
print("list", lst)
return lst
def main():
test = lf_csv()
test.generate_csv()