jupyter notebook 上的 FileNotFoundError(在 IBM Watson 工作室)

FileNotFoundError on jupyter notebook (at IBM Watson studio)

通过 运行 这个脚本,我收到了 "FileNotFoundError" 消息,但我找不到修复它的方法。我更改了文件和名称,但仍然出现此错误。

#STEP 2.1 - Take the Latitude and Longitude from the CSV file
ll = pd.read_csv(r'C:\Users\tayze\Geospatial.csv')
ll.sort_values(by='Postal Code', axis=0, ascending=True, inplace=True)

错误信息是:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-10-bb01332243b3> in <module>
      3 """
      4 #STEP 2.1 - Take the Latitude and Longitude from the CSV file
----> 5 ll = pd.read_csv(r'C:\Users\tayze\Geospatial.csv')
      6 ll.sort_values(by='Postal Code', axis=0, ascending=True, inplace=True)
      7 #print(ll.head())

如我的评论和您的回答中所述,您是 运行 远程服务器上的笔记本。通常,远程机器无法访问您的本地驱动器。如果他们可以,那将是一个严重的安全问题。

要使用本地数据,您需要将其上传到云服务可以访问的位置。来自 IBM Watson studio docs on accessing local data:

To upload the local data asset:

  1. In your project, go to your Assets page and clickadd data set . Alternatively, you can click Add data set from the project pull-down menu.
  2. Click the Local File tab.
  3. Drag or browse to your local file system to the palette. The file is now added to the project.