Need help to open excel file and read in Python

0 votes
Dear team,

I m unable to do read from excel file using Python. I need your help to read and extract data from excel file in Python.
Jul 22, 2019 in Python by Varshini
705 views

1 answer to this question.

0 votes

You can use pandas module to do so. You open a command prompt with administrator privileges and then execute this :

pip install pandas

This will download, install and add pandas to your existing python installation.

After that you can execute this code in a python file.

import pandas as pd
table = pd.read_excel('sales.xlsx',
                  sheetname = 'Month 1',
                  header = 0,
                  index_col = 0,
                  parse_cols = "A, C, G",
                  convert_float = True)

print(table)
answered Jul 22, 2019 by Tina

Related Questions In Python

+2 votes
1 answer

“OSError: Unable to open file (bad superblock version number)" in python h5py file read

File could indeed be opened on Linux ...READ MORE

answered Sep 26, 2018 in Python by Priyaj
• 58,090 points
6,136 views
0 votes
1 answer

How to read Excel File in Python

With pandas it is possible to get ...READ MORE

answered Oct 22, 2018 in Python by Priyaj
• 58,090 points
1,557 views
0 votes
1 answer

Need help extracting a schema to make use for an avro file in Python

Hi, nice question. So what I daily use ...READ MORE

answered Jan 10, 2019 in Python by Nymeria
• 3,560 points
4,554 views
0 votes
1 answer

How to create and read from a temporary file in Python?

Hi, there is a very simple solution ...READ MORE

answered Jan 29, 2019 in Python by Nymeria
• 3,560 points
1,775 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,051 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
3,466 views
0 votes
1 answer

How to read a large file, line by line, in Python?

The correct, fully Pythonic way to read ...READ MORE

answered Jul 1, 2019 in Python by SDeb
• 13,300 points
587 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP