We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 041fab1 + 8bad6b6 commit 9c8029eCopy full SHA for 9c8029e
CSV_files/read_csv.py
@@ -1,9 +1,9 @@
1
import csv
2
import pandas as pd
3
4
-def read_using_DictReader():
+def read_using_DictReader(path):
5
# opening the CSV file
6
- with open('CSV_files/assets/addresses.csv', mode ='r') as file:
+ with open(path, mode ='r') as file:
7
# reading the CSV file
8
csvFile = csv.DictReader(file)
9
@@ -18,7 +18,9 @@ def read_by_pandas_head():
18
def read_by_pandas_tail():
19
data=pd.read_csv('CSV_files/assets/addresses.csv')
20
return data.tail()
21
+
22
if __name__=="__main__":
23
+ print(read_using_DictReader('assets/addresses.csv'))
24
print(read_using_DictReader())
25
print(read_by_pandas_head())
26
print(read_by_pandas_tail())
0 commit comments