I am trying to import the data and facing issue with the encoding.
Some times utf-8 works but not latin-1, similarly it depends on the type of data coming.
Different encoding used - latin-1, utf-8, windows-1252
Code -
pd.read_csv(dir_in+file_note,sep='|',
low_memory=False,header=0,
error_bad_lines=False,
encoding = "windows-1252",
warn_bad_lines=False)
Please guide on how to make the code dynamic so that if one gives error it should try the other one.
1) Priority one will be utf-8
2) Priority two will be latin-1
3) Priority three will be windows-1252