MY CODE:-
将人口普查数据读入Pandas DataFrame*
file_path = Path("sfo_neighborhoods_census_data.csv")
sfo_data = pd.read_csv(file_path, index_col="year")
sfo_data.head()
错误:-
FileNotFoundError Traceback(最近一次调用最后一次)在1 #将人口普查数据读入Pandas DataFrame2 file_path = Path(" sfo_neighborhods_census_data .csv")——比;3 sfo_data = pd。read_csv (file_path index_col ="year"4 sfo_data.head ()
FileNotFoundError: [Errno 2] No such file or directory: 'sfo_neighborhoods_census_data.csv'
问题是您的文件目的地。你应该确保把它放在python代码保存的目录中。
如果你使用google colab,你可以上传你的文件到谷歌驱动器,然后挂载谷歌驱动器。这可以解决你的问题。