I want to print my pandas dataframes with newline characters actually being new lines. I can use the following code but it's quite verbose.
How can I set this globally, i.e., for this jupyter notebook?
df = pd.DataFrame({
'data': ['Laughing\nIs\nGood\nFor\nYou']
})
# Shows newline characters as '\n'
display(df)
# Actually prints new lines but is quite verbose
display(df.style.set_properties(**{
'text-align': 'left',
'white-space': 'pre-wrap',
}))