1

I'm trying to pretty print a Pandas dataframe without Header nor index, without success

This pretty prints but prints also header and index

import pandas as pd
from IPython.display import display

data=pd.DataFrame(same_data)
display(data)

enter image description here


This removes index (not header) but does not pretty prints

import pandas as pd
from IPython.display import display, Markdown

data=pd.DataFrame(same_data)
display(Markdown(data.to_markdown(index=False)))

enter image description here

What am I doing wrong?

1

1 Answer 1

0

For those coming here with the same problem, that's how I finally solved it

import pandas as pd
from IPython.display import display, HTML

display(HTML(
    ref_signs_table.to_html(
        index=False, 
        header=False, 
        notebook=True
    ).replace('<td>', '<td align="right">')
))

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.