我正在尝试使用pandas和jupyter笔记本从桌面上的子文件夹将excel文件读入数据框。该文件位于我的桌面上的一个文件夹中,该文件夹名为“Data”,子文件夹名为“KN Data”,子文件夹名为“New Files”,文件名为“Customers.xlsx”
以下是我正在尝试的代码:
df_customers = pd.read_excel (r"C:/Users/Zach/Desktop/Data/KN-Data/New-Files/Customers.xlsx")
错误是
[Errno 2] No such file or directory: 'C:/Users/Zach/Desktop/Data/KN-Data/New-Files/Customers.xlsx'
尝试使用双反斜杠而不是单正斜杠。我总是用双反斜杠,这对我很有用
您的代码应该是这样的:
相关问题 更多 >
编程相关推荐