Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Copy column from excel to array in python

I have values in an excel sheet that I want to easily transfer to my Python code. Is there any easy way to select all the cells you want from the sheet and then copy-paste them into the text editor with each cell value separated with a comma?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You may use pandas to do it:

import pandas as pd
df = pd.read_excel('your_file.xslx', sheetname='your_sheet_name')
your_array = df['your_column_name'].toarray()
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading