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 in Python by Varshini
21 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 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
• 56,520 points
900 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
• 56,520 points
111 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 in Python by Nymeria
• 3,520 points
403 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 in Python by Nymeria
• 3,520 points
45 views
+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 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 169 views
+4 votes
6 answers
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 in Python by SDeb
• 13,160 points
21 views
0 votes
1 answer

Is there a way to list out in-built variables and functions of Python?

The in-built variables and functions are defined ...READ MORE

answered May 14 in Python by Junaid
30 views