Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report