Issue
I would like to beautify my print output for a dataframe.
d = {'Carid ': [1, 2, 3], 'Carname': ['Mercedes-Benz', 'Audi', 'BMW'], 'model': ['S-Klasse AMG 63s', 'S6', 'X6 M-Power']}
df = pd.DataFrame(data=d)
print(df.head())
df.head()
As you can see the print
-outpot not beauty. The last statement of df.head()
is beauty.
Is there any option to get the same result in the print
-statement in Jupyter Notebook?
Solution
Use display instead of print.
display(df.head())
Answered By - Marcin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.