I am trying to work on a csv file in python
#code experiments
import csv
from statistics import mean
with open("C:\Users\xyr\zzz\kkkk\mmmm\ooooo\mpg.csv",'r') as csvfile:
reader=list(csv.DictReader(csvfile))
for item in reader:
print (item)
l=[item['cty']]
new_list=list(map(float,l))
res=(mean(new_list))
print (res)
gives me the error
unicodeescape' codec can't decode bytes in position
However, if I am opening same file in an environment of anaconda's jupyter notebook I am able to open the file. This error is coming when I am using python IDLE environment what could be the reason for this error, how can I get rid of these in IDLE environment? I have tried using single quotes instead of double quotes but still the error remains.