dataframe_image icon indicating copy to clipboard operation
dataframe_image copied to clipboard

converter - matplotlib_table.py - condition at row 147 - The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.

Open MichalRIcar opened this issue 1 year ago • 0 comments

Hi,

I have encountered a future warning using matplot, e.g. dfi.export(d, table_conversion='matplotlib').

The warning: "The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead."

I've tracked down the issue and it is coming from the matplotlib_table.py, row 147 in the converter folder, specifically the orig. condition

        if not thead and not tbody:
            for row in tree.findall(".//tr"):
                rows.append(parse_row(row))

as lxml etree object (thead) recommending - once I've changed the condition to :

        if not len(thead) and not len(tbody):
            for row in tree.findall(".//tr"):
                rows.append(parse_row(row))

the warning is gone and export works as expected.

MichalRIcar avatar Aug 29 '24 11:08 MichalRIcar