From 03d38a9d74cb890d7884e1d87f1540954659868e Mon Sep 17 00:00:00 2001 From: "D. Debnath" Date: Tue, 30 Apr 2024 18:41:27 +0530 Subject: [PATCH] Fix warning: Passing html literal strings is deprecated. See: https://github.com/pandas-dev/pandas/pull/53805 Passing html literal strings is deprecated. Wrap literal string/bytes input in ``io.StringIO``/``io.BytesIO`` instead. --- ISLP/models/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ISLP/models/__init__.py b/ISLP/models/__init__.py index ee124d3..df06e70 100644 --- a/ISLP/models/__init__.py +++ b/ISLP/models/__init__.py @@ -4,6 +4,7 @@ """ import numpy as np, pandas as pd +from io import StringIO from .model_spec import (ModelSpec, Column, @@ -46,7 +47,7 @@ def summarize(results, """ tab = results.summary().tables[1] - results_table = pd.read_html(tab.as_html(), + results_table = pd.read_html(StringIO(tab.as_html()), index_col=0, header=0)[0] if not conf_int: