Skip to main content

Posts

Showing posts with the label excel

xlrd python module for reading spreadsheets - Read the docs

xlrd module is a python module and is used for working with excel files or sprea dsheets . If you have seen the title I have named this post with Read the docs at the end. Do you k now why? python xlrd module documentation/tutorial Okay I will tell it to you. The first time I used python I got in love with this programming language the same way you fell in love with it. But one day I wanted to convert data in excel sheet to a dictionary for my computations. I thought that I could consider excel sheets as python file objects and proceed with computation. But th is method of using e xcel fi les as file o bjects didn 't work .  So I typed " Excel with python " in google and the results I saw were these: Google results for "Excel with python"  I chose the second result because the name( title ) was obvious and I found the xlrd module . I clicked on the documentations and expected this kind of documentation: Read the docs documentation s...

The XLRD python module for reading data in spreadsheets - Quickstart

In the previous post we have seen, how to install xlrd module . If you already have xlrd module installed on your computer then go ahead with this section other wise install the module having a look from here: The xlrd python module for reading excel spreadsheets - Installation . Eager to get started?This post will give you a good introduction to get started with the xlrd . First make sure that xlrd is installed on your computer. $ pip freeze . Check if xlrd is present in the list. xlrd is up-to-date. In IDLE   xlrd.info.__VERSION__ to see the version and check if you are up-to-date. Lets get started with something simple. Terminology Excel files are also called as workbooks or simply books . Also there can be n number of sheets in a given workbook .  Sheets in Excel File or workbook A cell is a box which contains only one entry or a single piece of data. Cell in Excel Worksheet A row is a horizontal group of cells. Row in Excel worksheet ...

The XLRD python module for reading excel spreadsheets - Installation

In the last post we have seen the introduction of the xlrd module. If you have missed it, you can see it from here: The XLRD python module for reading spreadsheets files - Introduction . We have seen the problems xlrd development team faced with the dates stored in the spreadsheets and the encoding.  In this post on Installation we will see how to install the module using pip , easy_install , virtualenv and manual installation .  Installation xlrd module doesn't depend on any third party libraries other than python standard library .  pip If you want to use pip to install the xlrd package then you can do as follows: $ pip install xlrd easy_install You can also install the xlrd package using easy install as follows: $ easy_install xlrd virtualenv You might sometimes have experienced that you want to install two libraries with same name or different versions of the same library. Also you don't want to install certain package to the whole computer b...

How to read data from excel or spreadsheet file with Python

We all are used to managing data using Excel sheets or spreadsheets , sometimes it becomes necessary for us to use the data stored in excel sheet for some computations using python .  In this tutorial we will be reading the data in an excel file using python xlrd module . According to official documentation at pypi xlrd is: xlrd module is a library to extract data from Excel sheets or spreadsheet files. Before we start we will have to install this module so that it can be used in our python script . If you have not yet installed this module on your computer then you can do the following: $ pip install xlrd You can also install using easy_install or by downloading the package from pypi , all of them have the same effect. We will start with IDLE so that we can understand each and every command in the interpreter easily. We will using roc.xls  for this tutorial and the spreadsheet(roc.xls) contains the following data: Roll Number Name Marks Rank 1 Pe...