${cwd} - the task runner's current working directory on startup.
The default setting of 'cwd' is the "${workspaceFolder}". In VSCode, the relative path depends on the setting parameter 'cwd', unless you use an absolute path. It doesn't care the relative path to your python file, it just cares the relative path to 'cwd'.
So you have two solutions to solve this problem:
First One:
Use the absolute path as you had tried and worked:
df = pd.read_csv(r'C:\Users\First Last\Documents\StatPython\file.csv')
or
df = pd.read_csv('C:\Users\irst Last\Documents\StatPython\file.csv')
Second One:
Take the path relative to default ${cwd}:
df = pd.read_csv('[the path of cwd][some paths]\file.csv')
In this case, seems like you haven't created a project of 'StatPython'. If it is your project name and opened by VSCode your code should be worked.