Load Excel file into numpy 2D array

后端 未结 1 838
天涯浪人
天涯浪人 2021-02-13 04:29

Is there an easier way to load an excel file directly into a Numpy array?

I have looked at the numpy.genfromtxt autoloading function from numpy documentatio

1条回答
  •  离开以前
    2021-02-13 05:08

    Honestly, if you're working with heterogeneous data (as spreadsheets are likely to contain) using a pandas.DataFrame is a better choice than using numpy directly.

    While pandas is in some sense just a wrapper around numpy, it handles heterogeneous data very very nicely. (As well as a ton of other things... For "spreadsheet-like" data, it's the gold standard in the python world.)

    If you decide to go that route, just use pandas.read_excel.

    0 讨论(0)
提交回复
热议问题