0

normally when we use the read function we get data only we don't get comments, sometimes those comments are also important for analysis, so any heads up would be helpful. Thank You

1

1 Answer 1

1

comments normally are on few random cell, hence you may have to loop through rows and cells to capture comments and Pandas may not help you, you may use openpyxl to do this

from openpyxl import load_workbook

workbook = load_workbook('yourexcel.xlsx')
sheet1 = workbook.get_sheet_names()[0]
worksheet = workbook.get_sheet_by_name(sheet1)

for row in worksheet.iter_rows():
    for cell in row:
        if cell.comment:
            print(cell.comment.text)
Sign up to request clarification or add additional context in comments.

1 Comment

okay seems a bit helpful, but I can't see my data and without data, there it's difficult looking|extracting the comments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.