I want to print the data in my excel file, segmenting it by cities names. For example I want to get all the columns for paris and put it in a new sheet, the columns for london and put it in another sheet etc. So far, i could only open the file and print the cities names. What is the method I should follow? So far I have:
# -*- coding: utf-8 -*-
import openpyxl as px
workbook = px.load_workbook('digital_trust.xlsx')
worksheet_names = workbook.get_sheet_names()
for worksheet_name in worksheet_names:
worksheet = workbook.get_sheet_by_name(worksheet_name)
for row in worksheet.iter_rows():
ville = row[3].value
print ville