dataframe_image
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.
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.