While parsing .ods file with pandas using read_excel() (and odf), how to drop comments in cells?

Viewed 233

I'm trying to parse .ods files with pandas, using pd.read_excel() function, which uses odf under the hood. The problem I face is simple: some cells have comments, and pandas treat them as if they were some regular content.

Here is a basic example ; given a very simple .ods file with a single comment:

enter image description here

Importing that file into a dataframe using

import pandas as pd 
df = pd.read_excel("example_with_comment.ods")

gives:

enter image description here

while I would have liked to retrieve the content of the cell only. Does anyone know how to drop the comments during parsing ?

I'm using pandas 1.3.4.

Thanks a lot to anyone who could give me a hint !

1 Answers
Related