0

I am trying to display a dataframe in a friendly way using df.to_html() using the following code:

import pandas as pd
# Friendely HTML Display
from IPython.display import display, HTML
sales = [{'account': 'Jones LLC', 'Jan': 150, 'Feb': 200, 'Mar': 140},
     {'account': 'Alpha Co',  'Jan': 200, 'Feb': 210, 'Mar': 215},
     {'account': 'Blue Inc',  'Jan': 50,  'Feb': 90,  'Mar': 95 }]

df = pd.DataFrame(sales)
print(df.to_html())

However, the results are displayed as in unrendered xml format

enter image description here

Samir Alhejaj
  • 157
  • 2
  • 16

0 Answers0