0

Is it possible to set a (dynamic) string equal to the output of a function?

Please see picture below...unfortunately, I'm not able to get it to work using the method shown here.

enter image description here

1 Answer 1

1

The code is actually working, but you need to make your simulator() function return the dataframe it makes. It prints it, but it doesn't return it:

Change the code for your simulator function to this:

def simulator():
    df = pd.DataFrame(np.random.randint(0,9,size=(4, 3)), columns=list('ABC'))
    return df  # instead of print(df)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.