# \#missing-values

**URL:** https://discourse.julialang.org/tag/missing-values/828.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [\[ANN\] MissingPatterns.jl — visualize missing data in the terminal](https://discourse.julialang.org/t/ann-missingpatterns-jl-visualize-missing-data-in-the-terminal/139114)

<div class="topic-metadata">

**Author:** [@dantebertuzzi](https://discourse.julialang.org/u/dantebertuzzi)\
**Replies:** 1\
**Last updated:** [August 31, 2026, 3:06am UTC](https://discourse.julialang.org/t/ann-missingpatterns-jl-visualize-missing-data-in-the-terminal/139114 "2026-08-31T03:06:47Z")

</div>

Hi everyone, I’d like to announce MissingPatterns.jl, a small toolkit for exploring missing data patterns directly in the terminal. The package started from a gap I kept running into: in Python I’d reach for missingno …

---

## [Avoiding a copy after removing missings from a vector](https://discourse.julialang.org/t/avoiding-a-copy-after-removing-missings-from-a-vector/130866)

<div class="topic-metadata">

**Author:** [@s-baumann](https://discourse.julialang.org/u/s-baumann)\
**Replies:** 9\
**Last updated:** [July 19, 2025, 2:27pm UTC](https://discourse.julialang.org/t/avoiding-a-copy-after-removing-missings-from-a-vector/130866 "2025-07-19T14:27:34Z")

</div>

In Julia I am trying to write a function that will (without copying) compute something from two vectors. As an example think of Pearson correlation (although it is not that). What I have got is: function get\_valid\_entr…

---

## [Get the maximum value by row in a DataFrame containing missing values](https://discourse.julialang.org/t/get-the-maximum-value-by-row-in-a-dataframe-containing-missing-values/118777)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 10\
**Last updated:** [August 30, 2024, 5:37am UTC](https://discourse.julialang.org/t/get-the-maximum-value-by-row-in-a-dataframe-containing-missing-values/118777 "2024-08-30T05:37:15Z")

</div>

I want to aggregate data over rows, which works well if the row contains some values. When the data row is empty maximum throws an error. Maybe someone has an idea how to make this faster. My table has usually about r…

---

## [How to differentiate using Zygote in the presence of missing values](https://discourse.julialang.org/t/how-to-differentiate-using-zygote-in-the-presence-of-missing-values/112822)

<div class="topic-metadata">

**Author:** [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Replies:** 0\
**Last updated:** [April 11, 2024, 10:05am UTC](https://discourse.julialang.org/t/how-to-differentiate-using-zygote-in-the-presence-of-missing-values/112822 "2024-04-11T10:05:18Z")

</div>

I have encountered a problem in my code. While I cannot easily write a MWE for my particular case, I thought that perhaps dealing with the following issue would help me further. Let us say, that we have some data y and…

---

## [Why are missing values not ignored by default?](https://discourse.julialang.org/t/why-are-missing-values-not-ignored-by-default/106756)

<div class="topic-metadata">

**Author:** [@alfaromartino](https://discourse.julialang.org/u/alfaromartino)\
**Replies:** 329\
**Last updated:** [January 17, 2024, 5:34am UTC](https://discourse.julialang.org/t/why-are-missing-values-not-ignored-by-default/106756 "2024-01-17T05:34:06Z")

</div>

I love Julia. The only feature that I don’t like is the treatment of missing values. It really hinders your work when working with data analysis. Comparison operators like \> and ==, and aggregate functions like sum and …

---

## [Error from conversion of missing values to NaNs](https://discourse.julialang.org/t/error-from-conversion-of-missing-values-to-nans/108321)

<div class="topic-metadata">

**Author:** [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Replies:** 12\
**Last updated:** [January 4, 2024, 2:35pm UTC](https://discourse.julialang.org/t/error-from-conversion-of-missing-values-to-nans/108321 "2024-01-04T14:35:35Z")

</div>

A is a value I read out of an NetCDF file (32 bit). Its size is 360x180x30. Here is my code to convert its missing values into NaNs: A\[ismissing.(A)\] .= NaN; Why does the above script work perfectly fine, but every t…

---

## [\[ANN\] Mice.jl - multiple imputation by chained equations in Julia](https://discourse.julialang.org/t/ann-mice-jl-multiple-imputation-by-chained-equations-in-julia/105994)

<div class="topic-metadata">

**Author:** [@tom-metherell](https://discourse.julialang.org/u/tom-metherell)\
**Replies:** 6\
**Last updated:** [December 12, 2023, 11:15am UTC](https://discourse.julialang.org/t/ann-mice-jl-multiple-imputation-by-chained-equations-in-julia/105994 "2023-12-12T11:15:42Z")

</div>

Hi everyone! This is just to introduce Mice.jl. This is a package for missing data handling via multiple imputation by chained equations, heavily based on the R package mice. I wouldn’t necessarily trust it 100% just ye…

---

## [Extending \`dropmissing\` to AbstractArrays](https://discourse.julialang.org/t/extending-dropmissing-to-abstractarrays/106753)

<div class="topic-metadata">

**Author:** [@Dan](https://discourse.julialang.org/u/Dan)\
**Replies:** 4\
**Last updated:** [November 26, 2023, 9:53pm UTC](https://discourse.julialang.org/t/extending-dropmissing-to-abstractarrays/106753 "2023-11-26T21:53:15Z")

</div>

From another thread, there was discussion of skipmissing, and it prompted me to think dropmissing is a convenient way to get rid of those pesky missings. DataFrames has dropmissing but regular Arrays don’t. How could it …

---

## [Drop rows of an array containing missing values](https://discourse.julialang.org/t/drop-rows-of-an-array-containing-missing-values/105258)

<div class="topic-metadata">

**Author:** [@ultratrader](https://discourse.julialang.org/u/ultratrader)\
**Replies:** 2\
**Last updated:** [October 21, 2023, 7:39am UTC](https://discourse.julialang.org/t/drop-rows-of-an-array-containing-missing-values/105258 "2023-10-21T07:39:36Z")

</div>

Hi guys, I want to drop rows containing missing values in an array. I can do this by converting the array to a df, and then using the skipmissing function from DataFrames.jl but I prefer to operate on an array rather th…

---

## [Predicting missing physics term for discrete time dynamical system](https://discourse.julialang.org/t/predicting-missing-physics-term-for-discrete-time-dynamical-system/103595)

<div class="topic-metadata">

**Author:** [@kunal](https://discourse.julialang.org/u/kunal)\
**Replies:** 3\
**Last updated:** [September 8, 2023, 4:18am UTC](https://discourse.julialang.org/t/predicting-missing-physics-term-for-discrete-time-dynamical-system/103595 "2023-09-08T04:18:24Z")

</div>

My use case is very much similar to Using DiffEqFlux.jl for system identification with partially known system dynamics . However my objective is to utilize this in case of a discrete time space system. I was following t…

---

## [Loess with missing values](https://discourse.julialang.org/t/loess-with-missing-values/90921)

<div class="topic-metadata">

**Author:** [@mreichMPI-BGC](https://discourse.julialang.org/u/mreichMPI-BGC)\
**Replies:** 11\
**Last updated:** [June 30, 2023, 3:07pm UTC](https://discourse.julialang.org/t/loess-with-missing-values/90921 "2023-06-30T15:07:52Z")

</div>

I want to use the Loess smoothing with missing values in y (and then fill those with the loess estimate). I hope I would be able to do it with pairwise from StatsBase, but did not manage. The code below works but feels …

---

## [How to replace all values in an array with missing values?](https://discourse.julialang.org/t/how-to-replace-all-values-in-an-array-with-missing-values/75467)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 43\
**Last updated:** [April 15, 2023, 12:24pm UTC](https://discourse.julialang.org/t/how-to-replace-all-values-in-an-array-with-missing-values/75467 "2023-04-15T12:24:26Z")

</div>

I have an array A with the size of 360 x 180 x 100. The current missing value indicator is NaN. My goal is to replace all NaN values with missing values. Below is my code: A\[isnan.(A)\] .= missing; Unfortunately, I got…

---

## [Vector of missing and float](https://discourse.julialang.org/t/vector-of-missing-and-float/96311)

<div class="topic-metadata">

**Author:** [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Replies:** 10\
**Last updated:** [March 20, 2023, 8:56pm UTC](https://discourse.julialang.org/t/vector-of-missing-and-float/96311 "2023-03-20T20:56:19Z")

</div>

Hello, I dropped missing values from a dataframe and then turned a column into a vector. The vector does not have missing values, but it has type: 7554-element Vector{Union{Missing, Float64}}: This prevents me from us…

---

## [How does replace.() work on a string vector containing missing?](https://discourse.julialang.org/t/how-does-replace-work-on-a-string-vector-containing-missing/96029)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 16\
**Last updated:** [March 14, 2023, 10:30am UTC](https://discourse.julialang.org/t/how-does-replace-work-on-a-string-vector-containing-missing/96029 "2023-03-14T10:30:37Z")

</div>

replace() and replace.() both work on the same string vector containing no missing julia\> vs=\["1.","2","3.","1"\] 4-element Vector{String}: "1." "2" "3." "1" julia\> replace(vs, "1"=\>"999") 4-element Vector{String}: …

---

## [Replace missing values based on column data type](https://discourse.julialang.org/t/replace-missing-values-based-on-column-data-type/94186)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 7\
**Last updated:** [February 10, 2023, 2:23am UTC](https://discourse.julialang.org/t/replace-missing-values-based-on-column-data-type/94186 "2023-02-10T02:23:18Z")

</div>

Hello, Question 1: I have df with multiple columns say a,b,c,d… so on and i would like to replace all missing values dynamically in each columns with 0(if column data type is int) and with “xyz” if column data type is …

---

## [Converting to an array that accepts 'missing' type](https://discourse.julialang.org/t/converting-to-an-array-that-accepts-missing-type/94111)

<div class="topic-metadata">

**Author:** [@austin-putz](https://discourse.julialang.org/u/austin-putz)\
**Replies:** 13\
**Last updated:** [February 7, 2023, 12:07pm UTC](https://discourse.julialang.org/t/converting-to-an-array-that-accepts-missing-type/94111 "2023-02-07T12:07:38Z")

</div>

So I have a matrix with mostly 0/1/2 values, but missing values are usually set = 5 for other programs. How can I set these values to missing? It seems simple but I cannot find an answer with julia docs (Missing Values ·…

---

## [Isusefulnumber()](https://discourse.julialang.org/t/isusefulnumber/93795)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 2\
**Last updated:** [January 30, 2023, 10:24pm UTC](https://discourse.julialang.org/t/isusefulnumber/93795 "2023-01-30T22:24:45Z")

</div>

Is there a function available to check in a large vector, if one of the following occurs in a vector: missing nothing Inf NaN ? Here is my snippet to investigate a vector for such elements: a = \[1.3, NaN, Inf, missi…

---

## [Summarizing grouped DataFrame where a group is entirely missing](https://discourse.julialang.org/t/summarizing-grouped-dataframe-where-a-group-is-entirely-missing/90920)

<div class="topic-metadata">

**Author:** [@mreichMPI-BGC](https://discourse.julialang.org/u/mreichMPI-BGC)\
**Replies:** 22\
**Last updated:** [December 18, 2022, 8:41pm UTC](https://discourse.julialang.org/t/summarizing-grouped-dataframe-where-a-group-is-entirely-missing/90920 "2022-12-18T20:41:43Z")

</div>

Dear community, when I want to summarize a grouped DataFrame e.g. with median and a group contains only missing, I get an error, because skipmissing returns an empty array and median(Float64\[\]) throws an error. The cod…

---

## [Function with vector of Union-Type](https://discourse.julialang.org/t/function-with-vector-of-union-type/88850)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 4\
**Last updated:** [October 17, 2022, 3:43pm UTC](https://discourse.julialang.org/t/function-with-vector-of-union-type/88850 "2022-10-17T15:43:57Z")

</div>

This does work: function \_foo1(\_range::AbstractVector=\[1,2\]) println(\_range) end \_foo1(\[1, missing\]) This fails: function \_foo2(\_range::Vector{Union{\<:Number, Missing}}=\[1, 2\]) println(\_range) end \_foo2(\[1, m…

---

## [Missing imputation: comparision of BetaML, Python SKL, R Mice](https://discourse.julialang.org/t/missing-imputation-comparision-of-betaml-python-skl-r-mice/72447)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [October 5, 2022, 2:58pm UTC](https://discourse.julialang.org/t/missing-imputation-comparision-of-betaml-python-skl-r-mice/72447 "2022-10-05T14:58:51Z")

</div>

Hello, I did a small benchmarking of Julia BetaML (predictMissing - that uses GMM - and custom random forest prediction), SciKitLearn SI, II and KK-based imputators and R Mice, using the default values for each. Below a…

---

## [Is there any reason to use NaN instead of missing?](https://discourse.julialang.org/t/is-there-any-reason-to-use-nan-instead-of-missing/84396)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 11\
**Last updated:** [July 19, 2022, 5:59pm UTC](https://discourse.julialang.org/t/is-there-any-reason-to-use-nan-instead-of-missing/84396 "2022-07-19T17:59:27Z")

</div>

I know that NaN isn’t going away because of the IEEE 754 standard on floating point behavior, but is there ever a reason to use NaN instead of converting and using missings as much as possible? Both are propagating non-v…

---

## [Variance-Covariance matrix with missing data](https://discourse.julialang.org/t/variance-covariance-matrix-with-missing-data/83312)

<div class="topic-metadata">

**Author:** [@Baba\_Yara\_Fahiz](https://discourse.julialang.org/u/Baba_Yara_Fahiz)\
**Replies:** 5\
**Last updated:** [June 25, 2022, 12:17am UTC](https://discourse.julialang.org/t/variance-covariance-matrix-with-missing-data/83312 "2022-06-25T00:17:39Z")

</div>

I am working with financial data where I have 600 matrices that are all 61 by 25000. I am computing the variance-covariance matrix but running into performance issues because of missing data. The way I am handling the …

---

## [Julian way to "remove" missing type in the eltype of a Matrix?](https://discourse.julialang.org/t/julian-way-to-remove-missing-type-in-the-eltype-of-a-matrix/83168)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 7\
**Last updated:** [June 22, 2022, 8:48am UTC](https://discourse.julialang.org/t/julian-way-to-remove-missing-type-in-the-eltype-of-a-matrix/83168 "2022-06-22T08:48:30Z")

</div>

julia\> A = \[1 2 missing; 4 5 6\] 2×3 Matrix{Union{Missing, Int64}}: 1 2 missing 4 5 6 julia\> A\[1,3\] = 3 3 julia\> A 2×3 Matrix{Union{Missing, Int64}}: 1 2 3 4 5 6 Now, I want to get rid of the missing in th…

---

## [How to Handle MissingException in Makie?](https://discourse.julialang.org/t/how-to-handle-missingexception-in-makie/82325)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 5\
**Last updated:** [June 6, 2022, 6:18pm UTC](https://discourse.julialang.org/t/how-to-handle-missingexception-in-makie/82325 "2022-06-06T18:18:09Z")

</div>

Hi all, I have columns in my dataframe as follows: These columns contain Ints as well as missings. I know that Makie.jl handles missings per this issue: handling vectors with \`Missing\` in type signature (even if the…

---

## [Remove leading zeros from string to int](https://discourse.julialang.org/t/remove-leading-zeros-from-string-to-int/82048)

<div class="topic-metadata">

**Author:** [@Billpete002](https://discourse.julialang.org/u/Billpete002)\
**Replies:** 1\
**Last updated:** [June 1, 2022, 11:43am UTC](https://discourse.julialang.org/t/remove-leading-zeros-from-string-to-int/82048 "2022-06-01T11:43:40Z")

</div>

So my data looks like: Stay Duration string3? ------- 001 012 missing 002 What I would like is someway to convert these to Int: Stay Duration Int64 ------- 1 12 missing 2 My normal method of converting a string to in…

---

## [SubString and missing](https://discourse.julialang.org/t/substring-and-missing/79017)

<div class="topic-metadata">

**Author:** [@gjh](https://discourse.julialang.org/u/gjh)\
**Replies:** 3\
**Last updated:** [April 4, 2022, 7:25pm UTC](https://discourse.julialang.org/t/substring-and-missing/79017 "2022-04-04T19:25:03Z")

</div>

with this vector str = \[“az”, “by”, missing, “cx”\] how can I get this returned using SubString? \[“a”, “b”, missing, “c”\] Thank you!

---

## [Replacing \*missing\* and \*NaN\* values in dataframe](https://discourse.julialang.org/t/replacing-missing-and-nan-values-in-dataframe/78687)

<div class="topic-metadata">

**Author:** [@janilin](https://discourse.julialang.org/u/janilin)\
**Replies:** 6\
**Last updated:** [March 29, 2022, 5:09pm UTC](https://discourse.julialang.org/t/replacing-missing-and-nan-values-in-dataframe/78687 "2022-03-29T17:09:07Z")

</div>

Hi! I was trying trying to change all missing and NaN values into 0. Firstly, created a dataframe using DataFrames df\_i = DataFrame( id =\[101, 102, 103, 104, 105\], name = \["A", "B", "C", NaN, "E"\], age = \[28, 3…

---

## [Fill missing kwarg in vcat function when cols = :union](https://discourse.julialang.org/t/fill-missing-kwarg-in-vcat-function-when-cols-union/78214)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 3\
**Last updated:** [March 22, 2022, 8:39am UTC](https://discourse.julialang.org/t/fill-missing-kwarg-in-vcat-function-when-cols-union/78214 "2022-03-22T08:39:45Z")

</div>

I am submitting to you a question which I believe to be of a general nature (along with other issues arising from the case), derived from a particular case on which I was working. I find myself in the need to make trans…

---

## [Difference handling missing of enumerate and eachindex](https://discourse.julialang.org/t/difference-handling-missing-of-enumerate-and-eachindex/78125)

<div class="topic-metadata">

**Author:** [@drandran12](https://discourse.julialang.org/u/drandran12)\
**Replies:** 3\
**Last updated:** [March 19, 2022, 2:10pm UTC](https://discourse.julialang.org/t/difference-handling-missing-of-enumerate-and-eachindex/78125 "2022-03-19T14:10:43Z")

</div>

The following behavior has cost me 6 hours of debugging. Is there a reason enumerate and eachindex handle the skipmissing itorator differently? julia\> a = \[missing, missing, missing, missing, missing, missing, missing, …

---

## [Filter a number when missing values are in column](https://discourse.julialang.org/t/filter-a-number-when-missing-values-are-in-column/76246)

<div class="topic-metadata">

**Author:** [@sai\_matcha](https://discourse.julialang.org/u/sai_matcha)\
**Replies:** 23\
**Last updated:** [February 11, 2022, 7:15pm UTC](https://discourse.julialang.org/t/filter-a-number-when-missing-values-are-in-column/76246 "2022-02-11T19:15:57Z")

</div>

Hi i want filter the rows having perticular value, but the column contains missing values as well. can some body help me to do this data frame i have df = DataFrame() df.a = (\[3,5,6,0,missing\]) df.b = 1:5 i want to fi…

[Next page](https://discourse.julialang.org/tag/missing-values/828.md?match_all_tags=true&page=1&tags%5B%5D=missing-values)
