Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use python to visualize the data in Excel in a page

Shulou Source: shulou.com Published: 2022-06-01 03:07:48 10月04日 Update

Editor to share with you how to use python to visualize the data in Excel on the page, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

one。 Demand

Recently, our teacher of data visualization asked us to visualize the house price data in the historical house prices in Guangzhou, and then sent us the historical house prices in Guangzhou .xls, and then took a look at the data. Anyway, it was a bit difficult to copy and paste, so I wanted to use python to help me modify the data into what I copied with one click.

two。 Install the xlrd module pip install xlrd

Usually pip comes with it, so we can import xlrd it in the development tools.

Here are the ways to cut each month of the year

Import xlrdpath = ringing E:\ data Analysis\ 07 Historical House prices in Guangzhou .xls'# sheetName is the table in your excel file For example, Sheet1 (pay attention to the case problem) sheetName = 'Sheet1'data = xlrd.open_workbook (path) table = data.sheet_by_name (sheetName) # number of rows rowAmount = number of table.nrows# columns colAmount = table.ncols# display the contents of the possessive case in the nth column datas= [] for rowIndex in range (1Magna rowIndex): datas.append (table.cell_value (rowIndex, 1) datas.reverse () index1=0index2=12time=2009while index2

Tags: Data house prices history Guangzhou visualization content articles pages effort not so much middle table size most size tools development tools possessive effects data analysis files Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Huawei NVidia Shulou Tech Info MySQL