Undefined values: Difference between revisions
Content added Content deleted
Line 614: | Line 614: | ||
[1] top-level scope at none:0 |
[1] top-level scope at none:0 |
||
</code> |
</code> |
||
2. For variables that are defined for the Julia program but have undefined values, there are two |
2. For variables that are defined for the Julia program but have undefined values, there are two types of undefined value in Julia (version > 0.7): <code> nothing </code> and <code> missing </code>. "nothing" and "missing" are typed constants used by convention to refer to either (with <code> nothing </code>) an absent result, such as a search with nothing found, or in the case of <code> missing, </code> a data location containing a missing value, such as a data table with missing values. <code>nothing</code> generally produces an error if any calculations incorporate it, but <code>missing</code> can be propagated along a calculation: |
||
<lang julia> |
<lang julia> |
||
julia> arr = [1, 2, nothing, 3] |
julia> arr = [1, 2, nothing, 3] |