{"id":16021822,"url":"https://github.com/davidanthoff/datavaluearrays.jl","last_synced_at":"2026-01-19T12:02:08.841Z","repository":{"id":74502422,"uuid":"91509214","full_name":"davidanthoff/DataValueArrays.jl","owner":"davidanthoff","description":"DEPRECATED","archived":false,"fork":false,"pushed_at":"2017-10-23T20:28:01.000Z","size":295,"stargazers_count":0,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-10T12:12:43.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidanthoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-16T22:15:30.000Z","updated_at":"2017-10-27T00:47:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"28d58ae0-d074-4b50-921f-7e111598dae1","html_url":"https://github.com/davidanthoff/DataValueArrays.jl","commit_stats":{"total_commits":216,"total_committers":17,"mean_commits":"12.705882352941176","dds":0.3935185185185185,"last_synced_commit":"75c0a234076f977f16a931a6c9e1020a82457db0"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidanthoff%2FDataValueArrays.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidanthoff%2FDataValueArrays.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidanthoff%2FDataValueArrays.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidanthoff%2FDataValueArrays.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidanthoff","download_url":"https://codeload.github.com/davidanthoff/DataValueArrays.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284918,"owners_count":20913691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T18:06:05.343Z","updated_at":"2026-01-19T12:02:08.799Z","avatar_url":"https://github.com/davidanthoff.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DataValueArrays.jl\n\nTHIS PACKAGE IS NO LONGER BEING MAINTAINED. ALL THE FUNCTIONALITY FROM THIS PACKAGE HAS BEEN MOVED INTO https://github.com/davidanthoff/DataValues.jl.\n\n[![Build Status](https://travis-ci.org/davidanthoff/DataValueArrays.jl.svg?branch=master)](https://travis-ci.org/davidanthoff/DataValueArrays.jl)\n[![Build status](https://ci.appveyor.com/api/projects/status/hspknlh93ma48ixr/branch/master?svg=true)](https://ci.appveyor.com/project/davidanthoff/datavaluearrays-jl/branch/master)\n[![DataValueArrays](http://pkg.julialang.org/badges/DataValueArrays_0.6.svg)](http://pkg.julialang.org/?pkg=DataValueArrays)\n[![codecov.io](http://codecov.io/github/davidanthoff/DataValueArrays.jl/coverage.svg?branch=master)](http://codecov.io/github/davidanthoff/DataValueArrays.jl?branch=master)\n\n## Overview\n\nDataValueArrays.jl provides the `DataValueArray{T, N}` type and its respective interface for use in storing and managing data with missing values.\n\n`DataValueArray{T, N}` is implemented as a subtype of `AbstractArray{DataValue{T}, N}` and inherits functionality from the `AbstractArray` interface.\n\n## Missing Values\nThe central contribution of DataValueArrays.jl is to provide a data structure that uses a single type, namely `DataValue{T}` to represent both present and missing values. `DataValue{T}` is a specialized container type that contains precisely either one or zero values. A `DataValue{T}` object that contains a value represents a present value of type `T` that, under other circumstances, might have been missing, whereas an empty `DataValue{T}` object represents a missing value that, under other circumstances, would have been of type `T` had it been present.\n\nIndexing into a `DataValueArray{T}` is thus \"type-stable\" in the sense that `getindex(X::DataValueArray{T}, i)` will always return an object of type `DataValue{T}` regardless of whether the returned entry is present or missing. In general, this behavior more robustly supports the Julia compiler's ability to produce specialized lower-level code than do analogous data structures that use a token `NA` type to represent missingness.\n\n## Constructors\nThere are a number of ways to construct a `DataValueArray` object. Passing a single `Array{T, N}` object to the `DataValueArray()` constructor will create a `DataValueArray{T, N}` object with all present values:\n```julia\njulia\u003e julia\u003e DataValueArray(collect(1:5))\n5-element DataValueArray{Int64,1}:\n 1\n 2\n 3\n 4\n 5\n ```\n To indicate that certain values ought to be represented as missing, one can pass an additional `Array{Bool, N}` argument; any index `i` for which the latter argument contains a `true` entry will return an missing value from the resultant `DataValueArray` object:\n ```julia\njulia\u003e X = DataValueArray([1, 2, 3, 4, 5], [true, false, false, true, false])\n5-element DataValueArray{Int64,1}:\n #NULL\n     2\n     3\n #NULL\n     5\n ```\n Note that the sizes of the two `Array` arguments passed to the above constructor method must be equal.\n \n `DataValueArray`s are designed to look and feel like regular `Array`s where possible and appropriate. Thus `display`ing a `DataValueArray` object prints the values of present entries and `#NULL` designator for missing entries. It is important to note, however, that there is no such `#NULL` object, and that indexing into a `DataValueArray` *always* returns a `DataValue` object, regardless of whether the entry at the specified index is missing or present:\n\n```julia\njulia\u003e X[1]\nDataValue{Int64}()\n\njulia\u003e X[2]\nDataValue(2)\n```\n\nOne can initialize an empty `DataValueArray` object by calling `DataValueArray(T, dims)`, where `T` is the desired element type of the resultant `DataValueArray` and `dims` is either a tuple or sequence of integer arguments designating the size of the resultant `DataValueArray`:\n\n```julia\njulia\u003e DataValueArray(Char, 3, 3)\n3x3 DataValueArray{Char,2}:\n #NULL  #NULL  #NULL\n #NULL  #NULL  #NULL\n #NULL  #NULL  #NULL\n ```\n\n## Indexing\nIndexing into a `DataValueArray{T}` is just like indexing into a regular `Array{T}`, except that the returned object will always be of type `DataValue{T}` rather than type `T`. One can expect any indexing pattern that works on an `Array` to work on a `DataValueArray`. This includes using a `DataValueArray` to index into any container object that sufficiently implements the `AbstractArray` interface:\n```julia\njulia\u003e A = [1:5...]\n5-element Array{Int64,1}:\n 1\n 2\n 3\n 4\n 5\n\njulia\u003e X = DataValueArray([2, 3])\n2-element DataValueArray{Int64,1}:\n 2\n 3\n\njulia\u003e A[X]\n2-element Array{Int64,1}:\n 2\n 3\n ```\n Note, however, that attempting to index into any such `AbstractArray` with a null value will incur an error:\n```julia\njulia\u003e Y = DataValueArray([2, 3], [true, false])\n2-element DataValueArray{Int64,1}:\n #NULL\n     3      \n\njulia\u003e A[Y]\nERROR: NullException()\n in _checkbounds at /Users/David/.julia/v0.4/DataValueArrays/src/indexing.jl:73\n in getindex at abstractarray.jl:424\n ```\n\n## `DataValueArray` Implementation Details\nUnder the hood of each `DataValueArray{T, N}` object are two fields: a `values::Array{T, N}` field and an `isnull::Array{Bool, N}` field:\n```julia\njulia\u003e fieldnames(DataValueArray)\n2-element Array{Symbol,1}:\n :values\n :isnull\n ```\nThe `isnull` array designates whether indexing into an `X::DataValueArray` at a given index `i` ought to return a present or missing value.\n\n## History\n\nThis package started as a fork of [NullableArrays.jl](https://github.com/JuliaStats/NullableArrays.jl)\nand owes a lot to the fantastic work contributors have done in that\nrepository to get things started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidanthoff%2Fdatavaluearrays.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidanthoff%2Fdatavaluearrays.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidanthoff%2Fdatavaluearrays.jl/lists"}