I am trying to create and return a data frame from a python function
def create_df():
data = {\'state\': [\'Ohio\',\'Ohio\',\'Ohio\',\'Nevada\',\'Nevada\'],
Function explicitly returns two DataFrames:
import pandas as pd
import numpy as np
def return_2DF():
date = pd.date_range('today', periods=20)
DF1 = pd.DataFrame(np.random.rand(20, 2), index=date, columns=list('xyz'))
DF2 = pd.DataFrame(np.random.rand(20, 4), index=date, columns='A B C D'.split())
return DF1, DF2
Calling and returning two data frame
one, two = return_2DF()