I am having a small issue that I cannot seem to solve. My program requires the user to input a path to a .csv file and then the program does stuff with it. Here is my code:
import pandas as pd
path = input("Please enter a path to a .csv file")
data = pd.read_csv(path)
I am running it in my terminal, so dragging the file into it yields what I believe to be the absolute path. The path looks like /Users/me/Downloads/sample.csv
and the error message is FileNotFoundError: [Errno 2] File b'/Users/me/Downloads/sample.csv ' does not exist: b'/Users/me/Downloads/sample.csv '
I attempted to concatenate an r in front of it so that it would treat it as a raw string (that's what my google search yielded) but that just put r's in the path. So my question is where are these b's coming from before the path and how do I make this variable path work?