Importing csv file

showing error UnicodeDecodeError when trying to read cs file. version 3.9

If you get a unicode decode error then next you need to [try to determine what the character encoding is, use below code :

import chardet     
with open(file, 'rb') as rawdata:
    result = chardet.detect(

Now you can manually define the encoding in pd.read_csv(),if unicode decode error is ISO-8859-1

oscar_demographics = pd.read_csv(file,encoding='ISO-8859-1')