# How to get value of a Dict() after optimization in Julia 1.1.0

**URL:** <https://discourse.julialang.org/t/how-to-get-value-of-a-dict-after-optimization-in-julia-1-1-0/22617>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [April 1, 2019, 11:18pm UTC](https://discourse.julialang.org/t/how-to-get-value-of-a-dict-after-optimization-in-julia-1-1-0/22617 "2019-04-01T23:18:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yan25y](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@yan25y](https://discourse.julialang.org/u/yan25y)\
**Post date:** [April 1, 2019, 11:18pm UTC](https://discourse.julialang.org/t/how-to-get-value-of-a-dict-after-optimization-in-julia-1-1-0/22617/1 "2019-04-01T23:18:06Z")

</div>

I’m using JuMP to solve an optimization problem using Julia 1.1.0. I expressed my variable in dictionary form so I can see which variable gets picked. When I do the optimization on my Mac, I’m able to see the result using getvalue() command after the optimization finishes, as shown below  
 ![49%20PM](https://global.discourse-cdn.com/julialang/original/3X/3/d/3da2c67162ed486c3abab6cd1d7e90f0ec83e57c.png)  
However, when I perform the optimization on Windows, first I have to use JuMP.value(), because getvalue() is deprecated, but then it wouldn’t let me check the value of the dictionary form variable. The error message is shown in the image below

 ![question%20for%20Julia](https://global.discourse-cdn.com/julialang/original/3X/e/9/e9779e28c632221f5173920837e624d7432ab7c2.png)  
Does anyone know how to get around this?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [April 2, 2019, 1:35am UTC](https://discourse.julialang.org/t/how-to-get-value-of-a-dict-after-optimization-in-julia-1-1-0/22617/2 "2019-04-02T01:35:00Z")

</div>

Use Julia’s broadcast syntax

```julia
JuMP.value.(f1)

```

See the JuMP docs [Query Solutions · JuMP](http://www.juliaopt.org/JuMP.jl/v0.19/solutions/#Obtaining-solutions-1)

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [April 2, 2019, 1:40am UTC](https://discourse.julialang.org/t/how-to-get-value-of-a-dict-after-optimization-in-julia-1-1-0/22617/3 "2019-04-02T01:40:26Z")

</div>

To be clear, those variables aren’t stored in a `Dict`, but in a [`JuMP.Containers.DenseAxisArray`](http://www.juliaopt.org/JuMP.jl/v0.19/containers/#JuMP.Containers.DenseAxisArray), which is why broadcasting makes sense in this case (it wouldn’t if it were truly a `Dict`).

---

<div class="post-metadata">

**Author:** ![yan25y](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@yan25y](https://discourse.julialang.org/u/yan25y)\
**Post date:** [April 6, 2019, 3:30pm UTC](https://discourse.julialang.org/t/how-to-get-value-of-a-dict-after-optimization-in-julia-1-1-0/22617/4 "2019-04-06T15:30:26Z")

</div>

Thank you!!

---

<div class="post-metadata">

**Author:** ![yan25y](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@yan25y](https://discourse.julialang.org/u/yan25y)\
**Post date:** [April 6, 2019, 3:30pm UTC](https://discourse.julialang.org/t/how-to-get-value-of-a-dict-after-optimization-in-julia-1-1-0/22617/5 "2019-04-06T15:30:28Z")

</div>

I see! Thank you!
