+ 1

How can I convert Excel data in tabular data in python by using file handling and function (I want to prepare gdp monitor)

Python

8th Sep 2021, 7:49 AM
alweena sabir
6 Réponses
8th Sep 2021, 7:53 AM
Prashanth Kumar
Prashanth Kumar - avatar
+ 2
There are few different ways, depends on what you want to do with the data/the format required. An easy method, would be to use the Pandas library: import pandas as pd file = 'example.xlsx' xl = pd.ExcelFile(file) df = xl.parse('Sheet1') As you have the convience of a pandas dataframe to boot. Makes data manipulation/comparisons a sinch. Another good library is Openpyxl
8th Sep 2021, 8:29 AM
DavX
DavX - avatar
+ 1
Prashanth Kumar can you pls send me the code snippet ...
8th Sep 2021, 8:13 AM
alweena sabir
+ 1
You can use matplotlib/pivot tables to visualize: import matplotlib.pyplot as plt x = df.some_col y = df.some_val plt.scatter(x, y) plt.show() Or for bar chart: bc = df.plot.bar(x='label', y='value', rot=0)
8th Sep 2021, 8:40 AM
DavX
DavX - avatar
0
Okay thnx
8th Sep 2021, 8:31 AM
alweena sabir
0
And what about this If want to convert Excel sheets in graph or pi charts
8th Sep 2021, 8:31 AM
alweena sabir