Quantcast
Channel: Return two data frames from a function with data frame format - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Return two data frames from a function with data frame format

$
0
0

I want to return two data frames from a function, like this:

def test():    df1 = pd.DataFrame([1,2,3], ['a','b','c'])    df2 = pd.DataFrame([4,5,6], ['d','e','f'])    return df1    return df2test()

But the function only returns one data frame df1. How to return both in pretty data frame format, not in cmd black background format?

When I tried to return both using

return df1, df2

in the Jupyter Notebook, the output returns the data frames in a black background cmd-like format, and not in proper data frame format.


Viewing all articles
Browse latest Browse all 3

Trending Articles