How to print DataFrame on single line

You need set:

pd.set_option('expand_frame_repr', False)

option_context context manager has been exposed through the top-level API, allowing you to execute code with given option values. Option values are restored automatically when you exit the with block:

#temporaly set expand_frame_repr
with pd.option_context('expand_frame_repr', False):
    print (df)

Pandas documentation.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)