3
votes

In some of the python scripts I use:

x = None

What would be the equivalent in Julia

Also in some numpy code I have I would use the following to coerce data to an array:

y = np.asarray(x)

Does julia have a similar function?

1

1 Answers

3
votes

For None, use nothing, e.g.

x = nothing
x + 1  # Error, meaningless

As for your second question, I don't think there is an equivalent. What precisely did you want to coerce into an array? In Julia there isn't a distinction between arrays and lists like there is in Python/Numpy.