How to get Excel data in an array using python

In the laboratory in which I work, we process a lot of data created by a 96-riton tablet reader. I am trying to speed up the process by writing a script that will calculate the percent cytotoxicity from light absorption (the easy part:]) and display a histogram using matplotlib.

The problem is that the card reader outputs data to a .xls file. I understand that some modules, such as pandas, have a read_excel function, can you explain how I should read the excel file and put it in the framework?

thank

Sample data of a 24-well plate (for simplicity):

0.0868  0.0910  0.0912  0.0929  0.1082  0.1350
0.0466  0.0499  0.0367  0.0445  0.0480  0.0615
0.6998  0.8476  0.9605  0.0429  1.1092  0.0644
0.0970  0.0931  0.1090  0.1002  0.1265  0.1455
+4
source share
4 answers

Pandas.

import pandas

df = pandas.read_excel('file_name_here.xlsx', sheet_name='Sheet1')

+4

, , , , :

import pandas as pd
df = pd.read_excel([path here])
df.as_matrix()

numpy.ndarray.

+5

xlrd . , . panda read_excel, xlrd , .

+1

, xlrd:

import pyexcel as pe     # pip install pyexcel
import pyexcel.ext.xls   # pip install pyexcel-xls
your_matrix = pe.get_array(file_name=path_here) # done
0

All Articles