相关疑难解决方法(0)

将Excel文件加载到numpy 2D数组中

有没有更简单的方法将excel文件直接加载到Numpy数组?

numpy.genfromtxt从numpy文档中查看了自动加载功能,但它没有直接加载excel文件.

array = np.genfromtxt("Stats.xlsx")
ValueError: Some errors were detected !
Line #3 (got 2 columns instead of 1)
Line #5 (got 5 columns instead of 1)
......
Run Code Online (Sandbox Code Playgroud)

现在我正在使用openpyxl.reader.excelread来读取excel文件,然后附加到numpy 2D数组.这似乎效率低下.理想情况下,我希望将excel文件直接加载到numpy 2D数组中.

python excel numpy

15
推荐指数
1
解决办法
4万
查看次数

标签 统计

excel ×1

numpy ×1

python ×1