【发布时间】:2021-10-03 18:33:08
【问题描述】:
想请问从 Github 加载数据有什么问题。下面的第一个代码可以从路径返回一个数组。
import csv
import numpy as np
wine_path ="https://raw.githubusercontent.com/deep-learning-with-pytorch/dlwpt-code/master/data/p1ch4/tabular-wine/winequality-white.csv"
wineq_numpy = np.loadtxt(wine_path, dtype = np.float32, delimiter=";", skiprows=1)
wineq_numpye
但是,尽管使用了相同的路径,但下面的第二个代码会返回错误。
col_list = next(csv.reader(open(wine_path), delimiter=';'))
wineq_numpy.shape, col_list
按摩提到
FileNotFoundError: [Errno 2] No such file or directory: 'https://raw.githubusercontent.com/deep-learning-with-pytorch/dlwpt-code/master/data/p1ch4/tabular-wine/winequality-white.csv'
错误的原因是什么?我只是在 google-colab 上写代码。 非常感谢您的帮助!
【问题讨论】:
标签: python-3.x google-colaboratory