在我的谷歌驱动器中,我有一个名为的文件夹Colab Notebooks/data/,如何将此路径附加到系统,这样我就不必提供数据文件的全名?我的尝试:from google.colab import drivedrive.mount('/content/drive')dat_dir = 'drive/My Drive/Colab Notebooks/data/' # read dataimport pandas as pdpd.read_csv(dat_dir + 'titanic_kaggle_train.csv') # this works我要这个pd.read_csv('titanic_kaggle_train.csv') # Here, I dont have full path我试过import syssys.path.append(dat_dir) # did not work# another attempt (did not work)!export PYTHONPATH=$HOME/drive/My\ Drive/Colab\ Notebooks/data/:$PYTHONPATH问题这个命令如何工作?pd.read_csv('titanic_kaggle_train.csv')
添加回答
举报
0/150
提交
取消