The error you’re encountering is due to the use of backslashes (\) in the file path, which are interpreted as escape characters in Python strings. To resolve this issue, you can use one of the following methods:
Prefix the string with r to treat it as a raw string, which will ignore escape sequences.
file_path = r'C:\Users\Florence Nightingale\Documents\Florence Nightingale Living Portrait\InputHistory.csv'
Replace each backslash with a double backslash to escape them properly.
file_path = 'C:\\Users\\Florence Nightingale\\Documents\\Florence Nightingale Living Portrait\\InputHistory.csv'
Replace backslashes with forward slashes, which are also supported in file paths on Windows.
file_path = 'C:/Users/Florence Nightingale/Documents/Florence Nightingale Living Portrait/InputHistory.csv'
Here’s how you might modify the original line in your script:
file_path = r'C:\Users\Florence Nightingale\Documents\Florence Nightingale Living Portrait\InputHistory.csv'
This should resolve the unicodeescape error you’re encountering.