Questions tagged [xlrd]

xlrd is a python library to extract data from Microsoft Excel spreadsheet files

xlrd is a python library to extract data from Microsoft Excel spreadsheet files.

xlrd can extract data from Excel spreadsheets (.xls and .xlsx, versions 2.0 onwards) on any platform, is written in pure Python and is Unicode-aware.

1366 questions
-2
votes
2 answers

Convert excel file into dictionary in python 3.5

I am having *.xlsx file like this Key value1 value2 test1 3 5 test2 6 7 test3 6 5 need to convert this into dictionary like below dict = {"test1":["3","5"]},{"test2":["6","7"]},{"test3":["6","5"]} Code: import pandas as pd df =…
usmanharoon
  • 173
  • 2
  • 13
-2
votes
1 answer

XLRD, .xls files, python

I have .xls file and I need to center align all the data in that excel file using python(any library). Any help is appreciated.
-2
votes
1 answer

The translation result should be in Column B in the same excel sheet (fruits.xlsx)

The below code translates words that is located in the fruits.xlsx in Column A. I want the output/result should be in Column B import xlrd import goslate loc = r"C:\path\fruits.xlsx" gs = goslate.Goslate() wb = xlrd.open_workbook(loc) sheet =…
kumar
  • 5
  • 5
-2
votes
2 answers

Getting data from an Excel file and print it to the console?

I developed the following code to extract data from an Excel file and print it in the console. This code is reading the data as intended and printing the content read into the console, but I want to print it differently. Instead of printing row by…
-2
votes
1 answer

Looking to load Excel values into a dictionary

I'm trying to load an Excel file into a Python dictionary and have it follow a specific format. Here is the Excel file: Here is the dict I would like to output: sheet1 = {'WLE-1-101':{'Max Height':8.19, 'Max Width':4.0, 'Laps':1}, …
bmorton
  • 11
  • 5
-2
votes
1 answer

Python max. 3 values, average and ploting

I am new in Python, I was working on that problem, but I faced with many errors. Firstly, I have 3 excel files, I need to find the highest 3 values from the each excel. Then, I need to take mean value of the each 3 highest values. After that, I need…
-2
votes
1 answer

How to get all cell.values except the first row of the sheet

Problem Statement: So far I can open the .xlsx with xlrd. Now I need to print all the cell.values except the first row, help pls Current Code: {import xlrd book = xlrd.open_workbook("test.xls") sheet = book.sheet_by_index(0)} Question: How can I…
Giacomo F
  • 7
  • 1
-2
votes
2 answers

How can compare two excel files for checking the format in python?

I have one excel sheet with right format(Certain number of headers and specific names). Here I have another excel sheet and I have to check this excel sheet for right format or not(have to be the same number of header and same header names, no issue…
Learner
  • 23
  • 1
  • 8
-2
votes
1 answer

Python Value Types (int, float, str)

I have an Excel sheet with the data as pictured:Cisco Call Handlers I'm working with Python 3 and reading data from the Excel sheet but since it has both integers and strings, I cannot specify the data type. What's the best way to handle value…
Gakusei
  • 1
  • 3
-2
votes
1 answer

Python: group by the dictionary keys and then need to perform the sum operation

input={1:5,2:8,9:3,11:4,18:3,21:4,3:8,350:5} and I would like to do the group by operation and perform the sum operation on the value of that dictionary. like grp_1=1,11,21 ; grp_2=9,3,18 ; grp_3= 2 and output should like as below grp_1= 13 (5+8+8…
-2
votes
1 answer

Python: print each excel row as its own ms word page

I've got an excel document with thousands of rows, each row represents a person's record. How can I use Python to extract each row and write that information into an MS Word page? My goal is to create a doc containing a pseudo-narrative of each…
Che
  • 35
  • 5
-2
votes
1 answer

How to read and write data in Microsoft excel 2010 in python

Steps what I have done 1.Reading input data from xlsx file 2.calculated week number and total hours done by each department Need to do: 1.Reading particular row column from another existing xlsx sheet 2.writing total hours for each department in…
doubts
  • 157
  • 1
  • 1
  • 9
-2
votes
1 answer

Graphic from xlsx to be used by python

I need to call for graphicall object ( basically a picture inserted to excel spreadsheet). Does anybody know how to do it? xlrd or win32com or something specific?
-2
votes
1 answer

How to iterate through excel file grabbing cell content and writing it in a form on a website

Here is what I have so far: Selenium and my python script can basically launch the browser, select the fields I want, input the text and click submit. What I would like to do: What I said above but instead of inputting the text based on hard coded…
dalearyous
  • 169
  • 1
  • 4
  • 15
-2
votes
1 answer

Removing column formatting in Excel worksheet using Python xlrd or xlutils

What I am attempting to duplicate using Python 2 is the following MS Excel action - 1) Select All 2) Copy 3) Special Paste - without formatting I have been pouring over xlrd and xlutils and although they have filtering capabilities I do not see what…
scopedial
  • 203
  • 1
  • 3
  • 7