I have a dataframe:
df = pd.DataFrame([1,2,3,4,5,6])
I have created a function which takes dataframe and % split as input and creates two new dataframes based on inputs
def splitdf(df,split=0.5):
a = df.iloc[:int(len(df)]*split)]
b = df.iloc[int((1-split)*len(df)):]
Now, when I run this function and call "a"
splitdf(df)
display(a)
I get the error: name 'a' is not defined