0

I'm trying print two or more dataframe in the output of jupyter notebook cell using Python. Actually I am using a function from Wes Mckinney that perform this work but the dataframes don't have headers. I would like that each table has title specifying the name of each table, of course. I need a function similar to function(dfs,names_dfs=[''])

The function that actually I am using is

def side_by_side(*objs, **kwds): 
    from pandas.io.formats.printing import adjoin
    space = kwds.get('space', 7)
    reprs = [repr(obj).split('\n') for obj in objs]
    print(adjoin(space, *reprs))

I hope you can help me. Thank's

Rodrigo López
  • 403
  • 1
  • 4
  • 17

1 Answers1

0

Jupyter is just the interpreter for python. So you don’t need to do anything special other than format the python output, like what’s done in this post: How to make two plots side-by-side using Python

Or here is another post explaining how to concatenate two dataframes for display: Pandas add dataframes side to side with different indexes

cwalvoort
  • 1,851
  • 1
  • 18
  • 19