I have an excel or text file that have some digits as a data. I want to load it to python and store them in a matrix. what can I do? (my excel file has 3 rows and 20 columns).
1 Answer
The file should be in some format. Excel files can be exported to csv format, than you can use Python's pandas module, the typical workflow is simple
import pandas as pd
data = pd.read_csv("mycsv.csv")
now data object is pandas.DataFrame object. Basically a 2D array.
1 Comment
MaxU - stand with Ukraine
pandas can easily read Excel files directly -
pd.read_excel()