# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=338

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

**Page:** 339

---

## [How to use Julia 1.9?](https://discourse.julialang.org/t/how-to-use-julia-1-9/92442)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 3\
**Last updated:** [January 25, 2023, 4:49am UTC](https://discourse.julialang.org/t/how-to-use-julia-1-9/92442 "2023-01-25T04:49:15Z")

</div>

I heard people use pre-release builds of Julia 1.9 but apparently the language server doesn’t support it. Are people using Julia without language server or what?

---

## [Type-inference with two variables that must have the same type](https://discourse.julialang.org/t/type-inference-with-two-variables-that-must-have-the-same-type/93421)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 13\
**Last updated:** [January 25, 2023, 4:32am UTC](https://discourse.julialang.org/t/type-inference-with-two-variables-that-must-have-the-same-type/93421 "2023-01-25T04:32:31Z")

</div>

julia\> fs() = rand(Bool) ? (1,1) : (1.0, 1.0) fs (generic function with 1 method) julia\> f(fs, i) = fs()\[i\] f (generic function with 1 method) julia\> g(fs) = (f(fs, 1), f(fs, 2)) g (generic function with 1 method) jul…

---

## [Logging error TensorBoardLogger with Flux](https://discourse.julialang.org/t/logging-error-tensorboardlogger-with-flux/93482)

<div class="topic-metadata">

**Author:** [@tchebycheff](https://discourse.julialang.org/u/tchebycheff)\
**Replies:** 0\
**Last updated:** [January 25, 2023, 2:00am UTC](https://discourse.julialang.org/t/logging-error-tensorboardlogger-with-flux/93482 "2023-01-25T02:00:45Z")

</div>

I have trouble logging Flux training output using TensorBoardLogger. The log file created has the following error message: Error! /Users/xxx/log/events.out.tfevents.xxxxx.local is not UTF-8 encoded Saving disabled See c…

---

## [Plotting histograms with GADFLY](https://discourse.julialang.org/t/plotting-histograms-with-gadfly/93467)

<div class="topic-metadata">

**Author:** [@ChrisVL1](https://discourse.julialang.org/u/ChrisVL1)\
**Replies:** 3\
**Last updated:** [January 24, 2023, 11:49pm UTC](https://discourse.julialang.org/t/plotting-histograms-with-gadfly/93467 "2023-01-24T23:49:27Z")

</div>

The “density = true” function is not working on my histogram, how do I fix this? prob1 = result3.u u2 = repeat(reshape(S₀, :, 1), 1, 200) y = predict\_neuralsde(prob1, u2)\[1,:,:\]' y1 = y\[end,:\] m = S₀.\*exp.(r.\*1) y\_sort …

---

## [Mysterious memory allocation](https://discourse.julialang.org/t/mysterious-memory-allocation/93431)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 16\
**Last updated:** [January 24, 2023, 10:34pm UTC](https://discourse.julialang.org/t/mysterious-memory-allocation/93431 "2023-01-24T22:34:49Z")

</div>

Using julia --track-allocation identifies the top hotspots in my code for memory allocation: - function zSQdensity(z::Float64, wa::WorkArea) 0 ev = wa.evaluator 0 dat::DataFrame = wa.dat …

---

## [\`@inferred\` check for a small \`Union\` without being specific about the types](https://discourse.julialang.org/t/inferred-check-for-a-small-union-without-being-specific-about-the-types/93470)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [January 24, 2023, 8:55pm UTC](https://discourse.julialang.org/t/inferred-check-for-a-small-union-without-being-specific-about-the-types/93470 "2023-01-24T20:55:23Z")

</div>

Suppose I have a function f(x) = x \> 1 ? 0 : x For this, I obtain julia\> @code\_warntype f(0.2) MethodInstance for f(::Float64) from f(x) @ Main REPL\[43\]:1 Arguments #self#::Core.Const(f) x::Float64 Body::Union{F…

---

## [Using \`load()\` from MLJ inside a package](https://discourse.julialang.org/t/using-load-from-mlj-inside-a-package/93413)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 4\
**Last updated:** [January 24, 2023, 6:24pm UTC](https://discourse.julialang.org/t/using-load-from-mlj-inside-a-package/93413 "2023-01-24T18:24:32Z")

</div>

Hi, I am trying to develop a package which will train multiple models according to the given input data and return the performance metrics (inspired from lazypredict · PyPI). I am using MLJ underneath to train multiple …

---

## [How do I drop only rows that are fully filled with missing values?](https://discourse.julialang.org/t/how-do-i-drop-only-rows-that-are-fully-filled-with-missing-values/93471)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 3\
**Last updated:** [January 24, 2023, 4:56pm UTC](https://discourse.julialang.org/t/how-do-i-drop-only-rows-that-are-fully-filled-with-missing-values/93471 "2023-01-24T16:56:42Z")

</div>

How do I drop only rows that are fully filled with missing values? df = DataFrame(a = \[missing,2,3,missing\], b = \[missing,5, 9, missing\], c=\[missing, 2,3,4\]) just remove row 1. I want to keep the other ones, even if t…

---

## [How to save an array to disk in compressed form?](https://discourse.julialang.org/t/how-to-save-an-array-to-disk-in-compressed-form/40325)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 9\
**Last updated:** [January 24, 2023, 2:32pm UTC](https://discourse.julialang.org/t/how-to-save-an-array-to-disk-in-compressed-form/40325 "2023-01-24T14:32:14Z")

</div>

Hello, how to save an array to disk in compressed form?

---

## [PackageCompiler libs and Python: Passing numpy arrays (or structs)](https://discourse.julialang.org/t/packagecompiler-libs-and-python-passing-numpy-arrays-or-structs/93406)

<div class="topic-metadata">

**Author:** [@wave\_and\_matter](https://discourse.julialang.org/u/wave_and_matter)\
**Replies:** 7\
**Last updated:** [January 24, 2023, 12:36pm UTC](https://discourse.julialang.org/t/packagecompiler-libs-and-python-passing-numpy-arrays-or-structs/93406 "2023-01-24T12:36:05Z")

</div>

I have succesfully tried out the PackageCompiler library + Python Ctypes example from Sadly the example is extremely simple and does not show how to pass parameters, especially arrays from python. I would be thankful …

---

## [What about an \`undefs\` function in \`Base\`?](https://discourse.julialang.org/t/what-about-an-undefs-function-in-base/92690)

<div class="topic-metadata">

**Author:** [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Replies:** 64\
**Last updated:** [January 24, 2023, 10:58am UTC](https://discourse.julialang.org/t/what-about-an-undefs-function-in-base/92690 "2023-01-24T10:58:38Z")

</div>

It would be nice to have an undefs function that operates the same way as zeros and ones. The syntax for initializing an array of zeros or ones is more concise than initializing an array of undefs but is not as efficient…

---

## [Efficient and in-place computation of A + adjoint(A)](https://discourse.julialang.org/t/efficient-and-in-place-computation-of-a-adjoint-a/93290)

<div class="topic-metadata">

**Author:** [@Ronan\_Gautier](https://discourse.julialang.org/u/Ronan_Gautier)\
**Replies:** 14\
**Last updated:** [January 24, 2023, 10:14am UTC](https://discourse.julialang.org/t/efficient-and-in-place-computation-of-a-adjoint-a/93290 "2023-01-24T10:14:04Z")

</div>

If A is any complex-valued matrix, is there a more efficient way of computing A + adjoint(A) in-place than the following ? function hermitian(A, A\_tmp) adjoint!(A\_tmp, A) A .+= A\_tmp end Benchmarking with using Li…

---

## [How should I account for measurement resolution (particularly in Measurements.jl)?](https://discourse.julialang.org/t/how-should-i-account-for-measurement-resolution-particularly-in-measurements-jl/93448)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 0\
**Last updated:** [January 24, 2023, 9:57am UTC](https://discourse.julialang.org/t/how-should-i-account-for-measurement-resolution-particularly-in-measurements-jl/93448 "2023-01-24T09:57:35Z")

</div>

Hi all! So I’m manipulating some data for my Master’s thesis. I integrated Unitful.js to keep track of the units of measure. Now I stumbled upon Measurements.jl to account for uncertainty propagation in my analysis. Acc…

---

## [Adding Package](https://discourse.julialang.org/t/adding-package/93414)

<div class="topic-metadata">

**Author:** [@BadBoy](https://discourse.julialang.org/u/BadBoy)\
**Replies:** 2\
**Last updated:** [January 24, 2023, 8:54am UTC](https://discourse.julialang.org/t/adding-package/93414 "2023-01-24T08:54:53Z")

</div>

Why i cannot able to add Julia 1.8.2 ClassImbalance Package ?? Also i cannot add Python package ‘imblearn’ using Conda.add(" "). Please can someone help me out.

---

## [Not able to run Julia through Flask-Celery](https://discourse.julialang.org/t/not-able-to-run-julia-through-flask-celery/91849)

<div class="topic-metadata">

**Author:** [@shwetank\_verma](https://discourse.julialang.org/u/shwetank_verma)\
**Replies:** 5\
**Last updated:** [January 24, 2023, 7:43am UTC](https://discourse.julialang.org/t/not-able-to-run-julia-through-flask-celery/91849 "2023-01-24T07:43:16Z")

</div>

We are working on SaaS based platform implemented using Flask and Celery. In the backend, we have some part of the implementation written in julia. We integrated julia using a python library called julia==0.6.0 In the…

---

## [Using HDF5.jl and reading h5 data to Julia?](https://discourse.julialang.org/t/using-hdf5-jl-and-reading-h5-data-to-julia/93232)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 9\
**Last updated:** [January 24, 2023, 6:28am UTC](https://discourse.julialang.org/t/using-hdf5-jl-and-reading-h5-data-to-julia/93232 "2023-01-24T06:28:23Z")

</div>

Hi all! I am new to .h5 data, so maybe I can get some help. I got some data from my research group. They work in Python and apparently somthin like this works for them: import h5py data, time, delta, name = read\_hd…

---

## [Switching between StaticArray and regular array depending on size (?)](https://discourse.julialang.org/t/switching-between-staticarray-and-regular-array-depending-on-size/93437)

<div class="topic-metadata">

**Author:** [@baptiste](https://discourse.julialang.org/u/baptiste)\
**Replies:** 5\
**Last updated:** [January 24, 2023, 3:49am UTC](https://discourse.julialang.org/t/switching-between-staticarray-and-regular-array-depending-on-size/93437 "2023-01-24T03:49:55Z")

</div>

I’m developing a package for physics simulations, where the core routine solves a dense linear system of complex equations, \\mathbf{A} \\mathbf{X} = \\mathbf{B} The matrix \\mathbf{A} can be small in some applications, …

---

## [Broadcast multi-valued function over array](https://discourse.julialang.org/t/broadcast-multi-valued-function-over-array/93435)

<div class="topic-metadata">

**Author:** [@jinfreedom](https://discourse.julialang.org/u/jinfreedom)\
**Replies:** 1\
**Last updated:** [January 24, 2023, 3:02am UTC](https://discourse.julialang.org/t/broadcast-multi-valued-function-over-array/93435 "2023-01-24T03:02:37Z")

</div>

I have a multi-valued function, e.g., (x,y)-\>F(x,y)=(fx(x,y), fy(x,y)), where I would like to redefine its broadcast behavior, such that F.(xArray,yArray) returns (fx.(xArray,yArray), fy.(xArray, yArray)), instead of the…

---

## [How to improve a Generator to be more memory efficient when it is collected?](https://discourse.julialang.org/t/how-to-improve-a-generator-to-be-more-memory-efficient-when-it-is-collected/92932)

<div class="topic-metadata">

**Author:** [@camilogarciabotero](https://discourse.julialang.org/u/camilogarciabotero)\
**Replies:** 21\
**Last updated:** [January 23, 2023, 6:26pm UTC](https://discourse.julialang.org/t/how-to-improve-a-generator-to-be-more-memory-efficient-when-it-is-collected/92932 "2023-01-23T18:26:18Z")

</div>

Hi all, I wrote a function that searches through a sequence (a BioSequences.LongDNA but could also be a String) for start codons (predefined as constants subsequence searches) and generates ranges of indices correspondi…

---

## [Share application on cluster: read-only access to JULIA\_DEPOT\_PATH?](https://discourse.julialang.org/t/share-application-on-cluster-read-only-access-to-julia-depot-path/93428)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 5\
**Last updated:** [January 23, 2023, 11:23pm UTC](https://discourse.julialang.org/t/share-application-on-cluster-read-only-access-to-julia-depot-path/93428 "2023-01-23T23:23:21Z")

</div>

To share a Julia CLI application with other users of the same cluster, is it OK if I ask them to invoke my Julia application from my bash script which sets JULIA\_DEPOT\_PATH to my own ~/.julia directory (using the absolut…

---

## [UnicodePlots.jl scatterplot! not mutating previous plot](https://discourse.julialang.org/t/unicodeplots-jl-scatterplot-not-mutating-previous-plot/93432)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 3\
**Last updated:** [January 23, 2023, 11:03pm UTC](https://discourse.julialang.org/t/unicodeplots-jl-scatterplot-not-mutating-previous-plot/93432 "2023-01-23T23:03:47Z")

</div>

Hello, good afternoon. Im trying to plot two series in a scatterplot using UnicodePlots and its not working. The first plot I created is not being mutating using the code below: here trying to mutate with other serie…

---

## [Why is ldiv! not updating the first argument when it is written in permutated format?](https://discourse.julialang.org/t/why-is-ldiv-not-updating-the-first-argument-when-it-is-written-in-permutated-format/93230)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 21\
**Last updated:** [January 23, 2023, 11:00pm UTC](https://discourse.julialang.org/t/why-is-ldiv-not-updating-the-first-argument-when-it-is-written-in-permutated-format/93230 "2023-01-23T23:00:35Z")

</div>

Hi all, Is there any reason that x\_perm is not updated in ldiv! similarly as in x? A = sparse(\[1.0 0 0; 0 6 0; 1 0 9\]); b = ones(3); x = zeros(3); x\_perm = zeros(3); permV = \[3, 1, 2\]; # permV is an permutated vector l…

---

## [How to calculate Jacobian matrix of a vector function using "IntervalArithmetic.jl" package?](https://discourse.julialang.org/t/how-to-calculate-jacobian-matrix-of-a-vector-function-using-intervalarithmetic-jl-package/93400)

<div class="topic-metadata">

**Author:** [@Kanishk](https://discourse.julialang.org/u/Kanishk)\
**Replies:** 1\
**Last updated:** [January 23, 2023, 10:06pm UTC](https://discourse.julialang.org/t/how-to-calculate-jacobian-matrix-of-a-vector-function-using-intervalarithmetic-jl-package/93400 "2023-01-23T22:06:01Z")

</div>

Hello Could you please help me to find out how to calculate the Jacobian matrix of below mentioned function using “IntervalArithmetic.jl” package in Julia. using IntervalArithmetic, Plots, ForwardDiff function model(x,…

---

## [How to adjust individual axes for AlgebraOfGraphics faceted plots?](https://discourse.julialang.org/t/how-to-adjust-individual-axes-for-algebraofgraphics-faceted-plots/93418)

<div class="topic-metadata">

**Author:** [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Replies:** 2\
**Last updated:** [January 23, 2023, 8:36pm UTC](https://discourse.julialang.org/t/how-to-adjust-individual-axes-for-algebraofgraphics-faceted-plots/93418 "2023-01-23T20:36:49Z")

</div>

I have a faceted plot drawn with, where rows and columns are mapped to some variables so I have a grid of figures. They are drawn with linked axes: facet=(; linkxaxes=:none, linkyaxes=:minimal), However, some axes beco…

---

## [Accelerating an N^2 nested loop](https://discourse.julialang.org/t/accelerating-an-n-2-nested-loop/93399)

<div class="topic-metadata">

**Author:** [@jibe](https://discourse.julialang.org/u/jibe)\
**Replies:** 13\
**Last updated:** [January 23, 2023, 5:33pm UTC](https://discourse.julialang.org/t/accelerating-an-n-2-nested-loop/93399 "2023-01-23T17:33:24Z")

</div>

Given a fixed integer N, and some arrays \\{ x\_{i} , y\_{i} \\}\_{i}, I am interested in (repeatedly) computing expressions of the form \\dot{x}\_{i} = - \\sum\_{j=1}^{N} (y\_{i} \\!-\\! y\_{j})/d\_{ij}; \\;\\; \\dot{y}\_{i} = \\sum\_{j=1…

---

## [Replace variable name in expression](https://discourse.julialang.org/t/replace-variable-name-in-expression/93186)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 12\
**Last updated:** [January 23, 2023, 7:10pm UTC](https://discourse.julialang.org/t/replace-variable-name-in-expression/93186 "2023-01-23T19:10:52Z")

</div>

I have a Julia expression that references the variable x, and need to replace all x references to y. However, I don’t find a reasonable way to do this. MacroTools is promising: julia\> MacroTools.replace(:( x + 1 ), :x,…

---

## [Warning using pythonplot() backend with Plots.jl](https://discourse.julialang.org/t/warning-using-pythonplot-backend-with-plots-jl/92412)

<div class="topic-metadata">

**Author:** [@alusiani](https://discourse.julialang.org/u/alusiani)\
**Replies:** 2\
**Last updated:** [January 23, 2023, 5:24pm UTC](https://discourse.julialang.org/t/warning-using-pythonplot-backend-with-plots-jl/92412 "2023-01-23T17:24:03Z")

</div>

Hi, with this simple example using Plots; pythonplot() scatter( \[1\], \[1\], ylims = (0, 2), xlims = (0, 2), ) I get the following warning sys:1: UserWarning: No data for colormapping provided via 'c'. Parameters…

---

## [Change decimal separator when plotting with PyPlot (or PythonPlot)](https://discourse.julialang.org/t/change-decimal-separator-when-plotting-with-pyplot-or-pythonplot/93367)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 8\
**Last updated:** [January 23, 2023, 2:57pm UTC](https://discourse.julialang.org/t/change-decimal-separator-when-plotting-with-pyplot-or-pythonplot/93367 "2023-01-23T14:57:01Z")

</div>

Hello everybody. When the time comes to publish the thesis, we may be faced with a big surprise: the University Library requires the decimal separator to be a comma, and they don’t want any excuses. So, hundreds of graph…

---

## [How to precisely control Plot size in mm?](https://discourse.julialang.org/t/how-to-precisely-control-plot-size-in-mm/87507)

<div class="topic-metadata">

**Author:** [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Replies:** 4\
**Last updated:** [January 23, 2023, 12:29pm UTC](https://discourse.julialang.org/t/how-to-precisely-control-plot-size-in-mm/87507 "2023-01-23T12:29:08Z")

</div>

How do I precisely control the size of the plot in mm? using Plots gr() p = scatter(rand(100),randn(100), size = (1000,1000), dpi = 300, title = "rand", titlefontsize = 9) savefig(p, "p.png") Here I’m expecting the fin…

---

## [Incorrect summation of Float64](https://discourse.julialang.org/t/incorrect-summation-of-float64/93376)

<div class="topic-metadata">

**Author:** [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Replies:** 8\
**Last updated:** [January 23, 2023, 10:51am UTC](https://discourse.julialang.org/t/incorrect-summation-of-float64/93376 "2023-01-23T10:51:15Z")

</div>

Can others reproduce this? I’m getting a strange result when adding 0.1 +0.2 \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ | Type "…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=337)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=339)
