I have problem in specifying path of my file in jupyter notebook/google colab. This is the example code I found:
import csv
csvFile = 'myData.csv'
xmlFile = 'myData.xml'
csvData = csv.reader(open(csvFile))
xmlData = open(xmlFile, 'w')
I do not know where the author of the code above place the myData.csv, so I have tried this code to locate my file:
csvFile = 'C:\Users\...\myData.csv'
but I get this error:
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
I also have tried this code:
csvFile = r'C:\Users\...\myData.csv'
but I get this error: FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\...\myData.csv'
My questions are: 1. Where the author of the code above place the myData.csv? 2. How can I specify the file location?