Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

dataframe python diplay 2 tables on same line

from IPython.core.display import display, HTML

def display_side_by_side(dfs:list, captions:list):
    """Display tables side by side to save vertical space
    Input:
        dfs: list of pandas.DataFrame
        captions: list of table captions
    """
    output = ""
    combined = dict(zip(captions, dfs))
    for caption, df in combined.items():
        output += df.style.set_table_attributes("style='display:inline'").set_caption(caption)._repr_html_()
        output += "xa0xa0xa0"
    display(HTML(output))
Comment

PREVIOUS NEXT
Code Example
Python :: Python fibonacci series (Recursion) 
Python :: python change font in 1 line 
Python :: import numpy as np import matplotlib.pyplot as plt index = 0 missClassifiedIndexes = [] for label, predit in zip(y_test, predictions): if label != predict: missClassifiedIndexes.append(index) index = +1 
Python :: django default template location 
Python :: fcn tensorflow 
Python :: a string varible in python 
Python :: boto3 upload to digital digitalocean folder 
Python :: how to plot quantity of each value of a feature in python 
Python :: how to save xml file in python 
Python :: export ifc dataframe python 
Python :: airflow find trigger type 
Python :: django query multiple 
Python :: star question in pyton 
Python :: Remove all duplicates words from a given sentence 
Python :: while loop choosing numbers 
Python :: merge python list items by index one after one 
Python :: select nth item from list 
Python :: Iterate through string in chunks in python 
Python :: reset csv.DictReader python 
Python :: RuntimeError: DataLoader worker (pid(s) 13615) exited unexpectedly 
Python :: sort vs sorted python 
Python :: how to change continuous colour in plotply 
Python :: append in dictionary with matrix values 
Python :: how to use wbtools in python 
Python :: treat NaN as a category 
Python :: medium how to interact with jupyter 
Python :: recursively count string 
Python :: extends template django file system 
Python :: python fibonacci sequence while loop 
Python :: add vertical line to horizontal graph 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =