-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2018_12_11_files.py
More file actions
51 lines (39 loc) · 1.23 KB
/
Copy path2018_12_11_files.py
File metadata and controls
51 lines (39 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 11 22:21:52 2018
@author: domenjemec
@title: 2018-12-11 file
"""
import csv
import numpy
d = "/Users/domenjemec/Downloads/Uber_Info/"
delivery_Csv = "Delivery.csv"
def main():
# Open a file for writing and create it if it doesn't exist
# f = open("textfile.txt", "w+")
# Open the file for appending text to the end
# f = open("textfile.txt", "a+")
# write some lines of data to the file
# for i in range(10):
# f.write("This is line %d\r\n" % (i+1))
# close the file when done
# f.close()
# Open the file back up and read the contents
f = open(d + delivery_Csv, "r")
if f.mode == 'r':
# check to make sure that the file was opened
# use the read() function to read the entire file
contents = f.read()
print(contents)
# fl = f.readlines()
# readlines reads the individual lines into a list
# for x in fl:
# print(x)
reader = csv.reader(open(d + delivery_Csv, "r"), delimiter=",")
x = list(reader)
print(x)
# a = numpy.loadtxt(open(d + delivery_Csv, "rb"), delimiter=",", skiprows=1)
# print(a)
if __name__ == "__main__":
main()