我做错什么了?在
我无法为我的Jupyter笔记本添加路径。我被卡住了。我的任何尝试都没有成功。在
home_dir="\C:\Users\User\Desktop\"
data_dir=home_dir + "\C:\Users\User\Desktop\A Student's Guide to Python for Physical Modeling by KInder and Nelson\code"
data_set=np.loadtxt(data_dir + "HIVseries.csv", delimiter=',')
将代码的第二行更改为:
代码将主目录添加到数据目录。你不能再把家也包括在内。只要提供相对路径就行了。
您所做的将使
data_dir
等于\C:\Users\User\Desktop\\C:\Users\User\Desktop\A Student's Guide to Python for Physical Modeling by KInder and Nelson\code
,这不是一个有效的路径。这是一个简单的问题,将
\C:\Users\User\Desktop\A Student's Guide to Python for Physical Modeling by KInder and Nelson\code
修改为C:\\Users\\User\\Desktop\\A Student's Guide to Python for Physical Modeling by KInder and Nelson\\code
。相关问题 更多 >
编程相关推荐