Answers for "showing multiple tables from the same input box jupyter"

0

showing multiple tables from the same input box jupyter

#Python, pandas
#Function on CSS created for this
from IPython.display import display_html
def display_side_by_side(*args):
    html_str=''
    for df in args:
        html_str+=df.to_html()
    display_html(html_str.replace('table','table style="display:inline"'),raw=True)

#Example
df1 = pd.DataFrame(np.arange(12).reshape((3,4)),columns=['A','B','C','D',])
df2 = pd.DataFrame(np.arange(16).reshape((4,4)),columns=['A','B','C','D',])
display_side_by_side(df1,df2,df1)
Posted by: Guest on March-13-2020

Code answers related to "showing multiple tables from the same input box jupyter"

Browse Popular Code Answers by Language