문제

Is it possible to fetch the tabular data copied from Excel into a list, tuple or dictionary using python? The data will contain multiple rows and columns, such as range A1:B10, therefore the python array should contain row and column index information as well

도움이 되었습니까?

해결책

I recommend you to save the file as csv and use numpy.genfromtxt

For instance

import numpy as np
data = np.genfromtxt("G:/mydata.csv", delimiter=',', dtype=object)

Choose your params accordingly. From an array you can easily convert to anything you like. If you know, that you have doubles all over, you can set dtype=np.float forthwith.

다른 팁

There are some libraries can help you read data from Excel files in Python.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top