# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1408

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

**Page:** 1409

---

## [Counting missing in a dataframe](https://discourse.julialang.org/t/counting-missing-in-a-dataframe/60186)

<div class="topic-metadata">

**Author:** [@statspy](https://discourse.julialang.org/u/statspy)\
**Replies:** 6\
**Last updated:** [April 28, 2021, 9:00pm UTC](https://discourse.julialang.org/t/counting-missing-in-a-dataframe/60186 "2021-04-28T21:00:56Z")

</div>

Lets say i have the following dataframe: df=DataFrame(A=\[1,2,missing\], B=\[10,missing,missing\]) I need to count how many missing’s in each column and get the result like this: A(1), B(2) i tried: collect(ismissing(x)…

---

## [Displaying an update message](https://discourse.julialang.org/t/displaying-an-update-message/12577)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 6\
**Last updated:** [April 28, 2021, 8:50pm UTC](https://discourse.julialang.org/t/displaying-an-update-message/12577 "2021-04-28T20:50:40Z")

</div>

Hello everyone. In a previous post about including a changelog in your repo, me and many others tried to argue how good it is for your users to have a changelog available to them. This post is about yet another improve…

---

## [LoadError: DimensionMismatch("arrays could not be broadcast to a common size; got a dimension with lengths 11 and 12"](https://discourse.julialang.org/t/loaderror-dimensionmismatch-arrays-could-not-be-broadcast-to-a-common-size-got-a-dimension-with-lengths-11-and-12/60189)

<div class="topic-metadata">

**Author:** [@ancrene2](https://discourse.julialang.org/u/ancrene2)\
**Replies:** 1\
**Last updated:** [April 28, 2021, 7:27pm UTC](https://discourse.julialang.org/t/loaderror-dimensionmismatch-arrays-could-not-be-broadcast-to-a-common-size-got-a-dimension-with-lengths-11-and-12/60189 "2021-04-28T19:27:29Z")

</div>

I think I understand what the error is, but I can’t find where I made the mistake. Can anyone help? LoadError: DimensionMismatch(“arrays could not be broadcast to a common size; got a dimension with lengths 11 and 12”) …

---

## [Solvers using JuMP and Clp](https://discourse.julialang.org/t/solvers-using-jump-and-clp/60193)

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 0\
**Last updated:** [April 28, 2021, 6:44pm UTC](https://discourse.julialang.org/t/solvers-using-jump-and-clp/60193 "2021-04-28T18:44:51Z")

</div>

I have this function, that is written using JuMP@0.18 and Clp and im struggling how can i update the syntax when using JuMP@0.21\` specially when it comes to the solver part: function scan(c::Channel) i = 1 …

---

## [Distributed loop and possible memory leak](https://discourse.julialang.org/t/distributed-loop-and-possible-memory-leak/60174)

<div class="topic-metadata">

**Author:** [@ovt](https://discourse.julialang.org/u/ovt)\
**Replies:** 0\
**Last updated:** [April 28, 2021, 3:06pm UTC](https://discourse.julialang.org/t/distributed-loop-and-possible-memory-leak/60174 "2021-04-28T15:06:09Z")

</div>

Hello, I’m trying to distribute some computation in a for loop among my procs. Here is what I tried: using Distributed addprocs(5) @everywhere begin using LinearAlgebra using SharedArrays using BenchmarkTools using Infi…

---

## [Importing python packages using PyCall throws up an error](https://discourse.julialang.org/t/importing-python-packages-using-pycall-throws-up-an-error/60166)

<div class="topic-metadata">

**Author:** [@varun7rs](https://discourse.julialang.org/u/varun7rs)\
**Replies:** 6\
**Last updated:** [April 28, 2021, 5:31pm UTC](https://discourse.julialang.org/t/importing-python-packages-using-pycall-throws-up-an-error/60166 "2021-04-28T17:31:31Z")

</div>

I’m trying to call some functions in the NetworkX package in my program using PyCall. However I get this error when I try doing this: using PyCall nx = pyimport("networkx") PyObject \<module 'networkx' from '/home/minerv…

---

## [Rocket (Reactive Programming) Actor to Actor Message Passing, etc](https://discourse.julialang.org/t/rocket-reactive-programming-actor-to-actor-message-passing-etc/59947)

<div class="topic-metadata">

**Author:** [@Jack](https://discourse.julialang.org/u/Jack)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 4:55pm UTC](https://discourse.julialang.org/t/rocket-reactive-programming-actor-to-actor-message-passing-etc/59947 "2021-04-28T16:55:04Z")

</div>

Greetings. I found this amazing package as a framework for reactive programming. I have a few questions about the best practice for some patterns. Actor to Actor message passing. The actor subscribes to an observable.…

---

## [LoadError: MethodError: objects of type Float64 are not callable](https://discourse.julialang.org/t/loaderror-methoderror-objects-of-type-float64-are-not-callable/60181)

<div class="topic-metadata">

**Author:** [@ancrene](https://discourse.julialang.org/u/ancrene)\
**Replies:** 1\
**Last updated:** [April 28, 2021, 4:38pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-objects-of-type-float64-are-not-callable/60181 "2021-04-28T16:38:21Z")

</div>

I’m working with SDEs. I’m very new to Julia so I’m just messing around with preexisting code to learn. Here is the error: LoadError: MethodError: objects of type Float64 are not callable in expression starting at \[nam…

---

## [Insert missing/nan elements in BitMatrix](https://discourse.julialang.org/t/insert-missing-nan-elements-in-bitmatrix/60179)

<div class="topic-metadata">

**Author:** [@Emmanouil\_Bakirtzis](https://discourse.julialang.org/u/Emmanouil_Bakirtzis)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 4:28pm UTC](https://discourse.julialang.org/t/insert-missing-nan-elements-in-bitmatrix/60179 "2021-04-28T16:28:48Z")

</div>

In Julia 1.6, I create a boolean array x= trues(3,2) and I want to reflect that an element is missing (or nan if it is compatible). I tried the following but they return errors x\[2,2\] = missing x\[2,2\] = NaN Is there …

---

## [I keep getting a syntax error saying my function needs and end, but I don't know why?](https://discourse.julialang.org/t/i-keep-getting-a-syntax-error-saying-my-function-needs-and-end-but-i-dont-know-why/60177)

<div class="topic-metadata">

**Author:** [@ancrene](https://discourse.julialang.org/u/ancrene)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 4:00pm UTC](https://discourse.julialang.org/t/i-keep-getting-a-syntax-error-saying-my-function-needs-and-end-but-i-dont-know-why/60177 "2021-04-28T16:00:33Z")

</div>

Below is the code. This is the error I get: ERROR: LoadError: syntax: incomplete: “function” at \[name\]COVID\_Project.jl:17 requires end using InstantiateFromURL using LinearAlgebra, Statistics, Random, SparseArrays usi…

---

## [ModelingToolkit.jl ODESystems with a forcing function: how to autodiff?](https://discourse.julialang.org/t/modelingtoolkit-jl-odesystems-with-a-forcing-function-how-to-autodiff/58823)

<div class="topic-metadata">

**Author:** [@Dhruva2](https://discourse.julialang.org/u/Dhruva2)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 3:54pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-odesystems-with-a-forcing-function-how-to-autodiff/58823 "2021-04-28T15:54:08Z")

</div>

Hi! Lots of differential equations models incorporate an external input function (e.g. a control system doing reference tracking). When I build models of this form in ModelingToolkit.jl, they don’t seem to be differenti…

---

## [Reading 12 bit integers from file](https://discourse.julialang.org/t/reading-12-bit-integers-from-file/60173)

<div class="topic-metadata">

**Author:** [@Shawly](https://discourse.julialang.org/u/Shawly)\
**Replies:** 4\
**Last updated:** [April 28, 2021, 3:42pm UTC](https://discourse.julialang.org/t/reading-12-bit-integers-from-file/60173 "2021-04-28T15:42:20Z")

</div>

I am new to Julia and trying to port some code from Matlab. I have an image file saved as a raw binary file with 12 bit precision. In Matlab I can use fread (Read data from binary file - MATLAB fread - MathWorks United K…

---

## [Is it possible to split a project in two?](https://discourse.julialang.org/t/is-it-possible-to-split-a-project-in-two/59214)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 3:18pm UTC](https://discourse.julialang.org/t/is-it-possible-to-split-a-project-in-two/59214 "2021-04-28T15:18:55Z")

</div>

What I want to do is this: I want to have the same project in two environments. In one environment I would only have names that functioned as calls for the model to compile and in the other environment I would have the c…

---

## [ForwardDiff and Floats](https://discourse.julialang.org/t/forwarddiff-and-floats/47596)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 13\
**Last updated:** [April 28, 2021, 2:18pm UTC](https://discourse.julialang.org/t/forwarddiff-and-floats/47596 "2021-04-28T14:18:58Z")

</div>

Hello, I am trying to use Ipopt in JuMP to solve a minimization problem with automatic differentiation. I am aware that I need to specify the types of the inputs as Real rather than Float64 but it’s not clear to me to …

---

## [Geom.contour in Gadfly.jl - How to use it?](https://discourse.julialang.org/t/geom-contour-in-gadfly-jl-how-to-use-it/60123)

<div class="topic-metadata">

**Author:** [@Adam\_Fleischhacker](https://discourse.julialang.org/u/Adam_Fleischhacker)\
**Replies:** 5\
**Last updated:** [April 28, 2021, 2:06pm UTC](https://discourse.julialang.org/t/geom-contour-in-gadfly-jl-how-to-use-it/60123 "2021-04-28T14:06:39Z")

</div>

I am trying to draw iso-density contours on a plot. Yet, it seems I am drawing lines all over the place – as opposed to contours representing different iso-densities (plot should be top-view of a mountain). I tried po…

---

## [WARNING: using Gaston.plot](https://discourse.julialang.org/t/warning-using-gaston-plot/60101)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 5\
**Last updated:** [April 28, 2021, 2:00pm UTC](https://discourse.julialang.org/t/warning-using-gaston-plot/60101 "2021-04-28T14:00:07Z")

</div>

How to avoid this alert? WARNING: using Gaston.plot in module Main conflicts with an existing identifier. WARNING: using Gaston.figure in module Main conflicts with an existing identifier. (@v1.5) pkg\>\> st Gaston Stat…

---

## [What does Ref on one hand and "aliasing a vector" on the other mean?](https://discourse.julialang.org/t/what-does-ref-on-one-hand-and-aliasing-a-vector-on-the-other-mean/60125)

<div class="topic-metadata">

**Author:** [@mocalvao](https://discourse.julialang.org/u/mocalvao)\
**Replies:** 7\
**Last updated:** [April 28, 2021, 1:35pm UTC](https://discourse.julialang.org/t/what-does-ref-on-one-hand-and-aliasing-a-vector-on-the-other-mean/60125 "2021-04-28T13:35:10Z")

</div>

Hi there, I started following the first IJulia notebook, constructors, of Kamiński’s nice tutorial on dataframes and found that, right after the construction of an example DataFrame: x = Dict("A" =\> \[1,2\], "B" =\> \[true…

---

## [Hessian matrix of ML model](https://discourse.julialang.org/t/hessian-matrix-of-ml-model/59933)

<div class="topic-metadata">

**Author:** [@March-08](https://discourse.julialang.org/u/March-08)\
**Replies:** 9\
**Last updated:** [April 28, 2021, 1:32pm UTC](https://discourse.julialang.org/t/hessian-matrix-of-ml-model/59933 "2021-04-28T13:32:13Z")

</div>

Hi. I would like to compute the Hessian matrix of my Flux model. I tried something like this without success: n = 100 X = rand(2, n) Y = rand(1, n) model = Chain(Dense(2,2),Dense(2,1)) loss(x,y) = Flux.mse(model(x),y…

---

## [How can I redefine the operator "≈" to my desired tolerance](https://discourse.julialang.org/t/how-can-i-redefine-the-operator-to-my-desired-tolerance/60072)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 7\
**Last updated:** [April 28, 2021, 1:26pm UTC](https://discourse.julialang.org/t/how-can-i-redefine-the-operator-to-my-desired-tolerance/60072 "2021-04-28T13:26:35Z")

</div>

Currently, “The binary operator ≈ is equivalent to isapprox with the default arguments” Hence: x ≈ y is equivalent to isapprox(x,y) How can I redefine the operator w/ my own custom tolerance: such that: x ≈ y is equiv…

---

## [Emacs ESS and latest julia version](https://discourse.julialang.org/t/emacs-ess-and-latest-julia-version/60165)

<div class="topic-metadata">

**Author:** [@harven](https://discourse.julialang.org/u/harven)\
**Replies:** 0\
**Last updated:** [April 28, 2021, 12:53pm UTC](https://discourse.julialang.org/t/emacs-ess-and-latest-julia-version/60165 "2021-04-28T12:53:01Z")

</div>

I am using ESS 18.10 with some recent version of julia 1.7.0-DEV.894 (2021-04-09) and I encounter the following weird behavior. julia\> let P = 10 P end returns let P = 10 C-c C-c With a multiline l…

---

## [How to deal with Julia Out of memory problem](https://discourse.julialang.org/t/how-to-deal-with-julia-out-of-memory-problem/60140)

<div class="topic-metadata">

**Author:** [@james1](https://discourse.julialang.org/u/james1)\
**Replies:** 5\
**Last updated:** [April 28, 2021, 11:40am UTC](https://discourse.julialang.org/t/how-to-deal-with-julia-out-of-memory-problem/60140 "2021-04-28T11:40:58Z")

</div>

LoadError: OutOfMemoryError() in expression starting at C:\\Users\\12984\\Desktop\\Interaction.jl:123 When I ran the program, I ran out of memory, as shown in the above statement. I tried to clean up the previous saved var…

---

## [Type stability for piecewise defined functions with expensive parts](https://discourse.julialang.org/t/type-stability-for-piecewise-defined-functions-with-expensive-parts/59790)

<div class="topic-metadata">

**Author:** [@alpharho](https://discourse.julialang.org/u/alpharho)\
**Replies:** 8\
**Last updated:** [April 28, 2021, 11:34am UTC](https://discourse.julialang.org/t/type-stability-for-piecewise-defined-functions-with-expensive-parts/59790 "2021-04-28T11:34:25Z")

</div>

The function function f(x) if x \< 0 return 0 end return expensive\_function(x) end Is not type-stable (in most cases). Is there a clean way to make it stable and generic, while staying performant for…

---

## [Error which only appears when inside sciML\_train call environment: ERROR: ArgumentError: unable to check bounds for indices of type Nothing](https://discourse.julialang.org/t/error-which-only-appears-when-inside-sciml-train-call-environment-error-argumenterror-unable-to-check-bounds-for-indices-of-type-nothing/59236)

<div class="topic-metadata">

**Author:** [@willsharpless](https://discourse.julialang.org/u/willsharpless)\
**Replies:** 12\
**Last updated:** [April 28, 2021, 11:22am UTC](https://discourse.julialang.org/t/error-which-only-appears-when-inside-sciml-train-call-environment-error-argumenterror-unable-to-check-bounds-for-indices-of-type-nothing/59236 "2021-04-28T11:22:18Z")

</div>

Hi all, I get this type error which appears after I try to index with the output of indexin() which is of type: Array{Union{Nothing, Int64},1}. I have tried to fix this via all of the following methods: match\_idx =…

---

## [Counting Value Occurences in Time Range in DataFrames](https://discourse.julialang.org/t/counting-value-occurences-in-time-range-in-dataframes/60097)

<div class="topic-metadata">

**Author:** [@TBulka](https://discourse.julialang.org/u/TBulka)\
**Replies:** 3\
**Last updated:** [April 28, 2021, 10:47am UTC](https://discourse.julialang.org/t/counting-value-occurences-in-time-range-in-dataframes/60097 "2021-04-28T10:47:08Z")

</div>

Hello everyone, say, I construct a data frame like this: using Dates using DataFrames datevec = collect(Date(2020, 02, 22):Day(1):Date(2020, 03, 03)) valuevec = \["A", "B", "A", "A", "C", "C", "A", "C", "A", "A", "B"\] …

---

## [Plot without updating limits](https://discourse.julialang.org/t/plot-without-updating-limits/60157)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 3\
**Last updated:** [April 28, 2021, 10:32am UTC](https://discourse.julialang.org/t/plot-without-updating-limits/60157 "2021-04-28T10:32:08Z")

</div>

I want to plot a bunch of concentric circles but I don’t want them to update the limits of the axis. The idea is to show radial distance to some specific point. Any way I can do that? So instead of: I’d like to have…

---

## [How to invert variables in the objective of an optimization model](https://discourse.julialang.org/t/how-to-invert-variables-in-the-objective-of-an-optimization-model/60154)

<div class="topic-metadata">

**Author:** [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 10:16am UTC](https://discourse.julialang.org/t/how-to-invert-variables-in-the-objective-of-an-optimization-model/60154 "2021-04-28T10:16:38Z")

</div>

The optimization problem is： minimize log detP^−1 subject to ||Pu+ buro||\\2≤ 1, where P is a semidefinite matrix, buro is Variable, u is known. The code is: using Convex, SCS, LinearAlgebra if VERSION \< v"1.2.0-DEV.…

---

## [Colorbar and colsize](https://discourse.julialang.org/t/colorbar-and-colsize/60093)

<div class="topic-metadata">

**Author:** [@AshtonSBradley](https://discourse.julialang.org/u/AshtonSBradley)\
**Replies:** 7\
**Last updated:** [April 28, 2021, 10:00am UTC](https://discourse.julialang.org/t/colorbar-and-colsize/60093 "2021-04-28T10:00:51Z")

</div>

I can’t figure out how to make this plot. I want a column of Aspect(1,1) heatmaps down the left, with matching rectangle plots on the right that take up the space. I can get here fine: fig = Figure(resolution=(1192, 20…

---

## [Seemingly large permformance regression on "^" power operator in \>=1.6](https://discourse.julialang.org/t/seemingly-large-permformance-regression-on-power-operator-in-1-6/60156)

<div class="topic-metadata">

**Author:** [@smpurkis](https://discourse.julialang.org/u/smpurkis)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 9:52am UTC](https://discourse.julialang.org/t/seemingly-large-permformance-regression-on-power-operator-in-1-6/60156 "2021-04-28T09:52:32Z")

</div>

Hello, I was doing a benchmark between Julia and a few other programming languages (Python, c++), when I was surprised to see Julia being slow compared to previous versions. A quick benchmark between Julia 1.6.1 (1.6.0 …

---

## [Conditional inside a function to be optimized](https://discourse.julialang.org/t/conditional-inside-a-function-to-be-optimized/48563)

<div class="topic-metadata">

**Author:** [@danuzco](https://discourse.julialang.org/u/danuzco)\
**Replies:** 18\
**Last updated:** [April 28, 2021, 9:18am UTC](https://discourse.julialang.org/t/conditional-inside-a-function-to-be-optimized/48563 "2021-04-28T09:18:41Z")

</div>

I’m trying to maximize this function function C\_opt(s) pax, pby = OffsetArray( zeros(Float64, (2,2)), (0:1,0:1) ), OffsetArray( zeros(Float64, (2,2)), (0:1,0:1) ) Cmax = 0 for l=0:15 pax\[0,…

---

## [Autodiff: calculate just the diagonal of the Hessian](https://discourse.julialang.org/t/autodiff-calculate-just-the-diagonal-of-the-hessian/22893)

<div class="topic-metadata">

**Author:** [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Replies:** 6\
**Last updated:** [April 8, 2019, 6:36am UTC](https://discourse.julialang.org/t/autodiff-calculate-just-the-diagonal-of-the-hessian/22893 "2019-04-08T06:36:02Z")

</div>

Given a function f(x) from R^2 → R, is there an efficient way to calculate just the diagonal entries of the Hessian matrix using any of the autodiff tools? I know that at the function’s max, all the off-diagonal partials…

[Previous page](https://discourse.julialang.org/latest.md?page=1407)

[Next page](https://discourse.julialang.org/latest.md?page=1409)
