You can create a temporary file containing HTML of the whole table, and then use the webbrowser
module to open in. It would probably be best to simply create a function for displaying data frames in a new window:
import webbrowser
import pandas as pd
from tempfile import NamedTemporaryFile
def df_window(df):
with NamedTemporaryFile(delete=False, suffix='.html') as f:
df.to_html(f)
webbrowser.open(f.name)
df = pd.DataFrame({'a': [10, 10, 10, 11], 'b': [8, 8 ,8, 9]})
df_window(df)
Edit: In my answer here I show how to display a table in a new window with pagination, search, sort and other cool stuff using JQuery+DataTables.