Working with Excel Spreadsheets in python .pptx

romalyorash70 94 views 13 slides Oct 12, 2024
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

Name : Romal Yorish
Whatsapp : +93706405087
Form more info can you send me message on WhatsApp


Slide Content

Names : Romal Yorish Muhammad Saber Sidiq Ahmad Taeb Baryali

Outline:- Why we use excel in python Excel Documents Installing the openpyxl Module Reading(opening) excel documents Getting Sheets from the Workbook Getting Cells from the Sheets

Why We Use Excel in Python ? Excel is a popular and powerful spreadsheet application for Windows . The openpyxl module allows your Python programs to read and modify Excel spreadsheet files. For example, you might have the boring task of copying certain data from one spreadsheet and pasting it into another one. Or you might have to go through thousands of rows and pick out just a handful of them to make small edits based on some criteria.

Excel Documents An Excel spreadsheet document is called a workbook . A single workbook is saved in a file with the . xlsx extension. Each workbook can contain multiple sheets (also called worksheets ). The sheet the user is currently viewing (or last viewed before closing Excel) is called the active sheet .

Installing the Openpyxl Module Python does not come with OpenPyXL , so you’ll have to install it. Follow the instructions for installing tow-party modules in Appendix Step 1:- You can by write pip install openpyxl in CMD install this library . Step 2:- The name of the module is openpyxl. To test whether it is installed correctly , enter the following into the interactive shell:

Opening Excel Documents For this task we must write this code : >>> import openpyxl.load_workbook ( Path )

Getting Sheets from the Workbook For this task :-

Getting Cells from the Sheets

Getting Rows and Columns from the Sheets

Output

For more Question ?