1
Having the following content in my file . xls:
Belo Horizonte - MG 2278.8
Porto Alegre - RS 1647.8
Recife - PE 2434.9
Rio de Janeiro - RJ 1653.6
Salvador - BA 2324.1
São Paulo - SP 2227.5
Total of areas 14640.1
How to plot data from file . xls, transforming it into a graph (of any type)?
I was able to read the data with the following code:
import openpyxl
import matplotlib.pyplot as plt
book = openpyxl.load_workbook('planilha.xlsx')
sheet = book.active
celulas = sheet['A2':'B8']
for c1, c2 in celulas:
print("{0:8} {1:8}".format(c1.value, c2.value))
But I don’t know how to proceed.
I thought about using the matplotlib library, but as I said above, I don’t know how to proceed.