How to access an object created inside a module in julia

Viewed 53

I would like to access a dataframe created within a function within a module in julia.

module mymodule
df = DataFrame()
function trial(x)
    df = DataFrame(A = [x, 2], B = [4, 5])
    push!(df, [3 6])
end
end

My code in my other file is:

mymodule.trial(10)

I'm hoping to access the new df object, but I get nothing. I've read the scoping section exhaustively, exporting, and structs. I'm needing to be pointed in the right direction. Thanks

1 Answers

Ok, this was rather simple. I just needed to create an object: df = mymodule.trial(10) allowed me to access the dataframe object.

Related