# General Usage

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

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

**Page:** 145

---

## [Python map\_coordinates() equivalent in Julia](https://discourse.julialang.org/t/python-map-coordinates-equivalent-in-julia/117461)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 29\
**Last updated:** [August 4, 2024, 8:53am UTC](https://discourse.julialang.org/t/python-map-coordinates-equivalent-in-julia/117461 "2024-08-04T08:53:42Z")

</div>

What would be julia equivalent of that python code ? I am using map\_coordinates — SciPy v1.14.0 Manual function. Here vals\_r ,r\_grid\_stream\_pixand theta\_grid\_stream\_pix are of type Matrix{Float64}. vals\_r = map\_coordina…

---

## [Array/Image zoom](https://discourse.julialang.org/t/array-image-zoom/52085)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 7\
**Last updated:** [August 4, 2024, 8:14am UTC](https://discourse.julialang.org/t/array-image-zoom/52085 "2024-08-04T08:14:23Z")

</div>

Does anyone know if there is a package providing a function like scipy.ndimage.zoom https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.zoom.html?

---

## [LoadError: UndefVarError: Printf not defined](https://discourse.julialang.org/t/loaderror-undefvarerror-printf-not-defined/67482)

<div class="topic-metadata">

**Author:** [@GoH](https://discourse.julialang.org/u/GoH)\
**Replies:** 6\
**Last updated:** [August 4, 2024, 12:11am UTC](https://discourse.julialang.org/t/loaderror-undefvarerror-printf-not-defined/67482 "2024-08-04T00:11:32Z")

</div>

Hi, I just found the @printf does not work for me. Here is the code. I run it on Pluto. begin using Printf Printf.@printf end and the error is LoadError: UndefVarError: Printf not defined in expression starting at …

---

## [The good example of bpinn](https://discourse.julialang.org/t/the-good-example-of-bpinn/117781)

<div class="topic-metadata">

**Author:** [@whucsu](https://discourse.julialang.org/u/whucsu)\
**Replies:** 2\
**Last updated:** [August 3, 2024, 6:40pm UTC](https://discourse.julialang.org/t/the-good-example-of-bpinn/117781 "2024-08-03T18:40:25Z")

</div>

the example of Bayesian Physics informed Neural Network ODEs Solvers is nice. after executing, it takes about 9 minutes for one inference. I tried to use cuda gpu with the help of Monica gpt, but failed to execute. ca…

---

## [Cross derivatives using MethodOfLines?](https://discourse.julialang.org/t/cross-derivatives-using-methodoflines/117782)

<div class="topic-metadata">

**Author:** [@MSTIITB](https://discourse.julialang.org/u/MSTIITB)\
**Replies:** 0\
**Last updated:** [August 3, 2024, 3:39am UTC](https://discourse.julialang.org/t/cross-derivatives-using-methodoflines/117782 "2024-08-03T03:39:56Z")

</div>

I was wondering if MethodOfLines allows cross derivatives. Something like this: Dxt = Differential(x)\*Differential(t) My equation looks something like this: eq = \[Dtt(F(t,x)) + 2\*Dxt(F(t,x)) ~ A\*Dxx(F(t,x)) + B\*Dx(F(t…

---

## [How to play a sound or tone when a program ends?](https://discourse.julialang.org/t/how-to-play-a-sound-or-tone-when-a-program-ends/41239)

<div class="topic-metadata">

**Author:** [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Replies:** 34\
**Last updated:** [August 3, 2024, 1:47am UTC](https://discourse.julialang.org/t/how-to-play-a-sound-or-tone-when-a-program-ends/41239 "2024-08-03T01:47:35Z")

</div>

Hi, I was wondering how to set a julia program to beep or play some tones or music when a long program finally finishes running. (Googling this question leads to recommendations for old packages, like AudioIO, which are…

---

## [Simple Devcontainer vscode for Julia SciML + PyCall](https://discourse.julialang.org/t/simple-devcontainer-vscode-for-julia-sciml-pycall/117776)

<div class="topic-metadata">

**Author:** [@msfz751](https://discourse.julialang.org/u/msfz751)\
**Replies:** 0\
**Last updated:** [August 2, 2024, 10:45pm UTC](https://discourse.julialang.org/t/simple-devcontainer-vscode-for-julia-sciml-pycall/117776 "2024-08-02T22:45:44Z")

</div>

I am exploring SciML with Julia and found that the best way to experiment with Julia advanced feature without touchingt the core OS was using Devcontainers via vscode. This could be useful for beginners. This is is simp…

---

## [How to use format\_md in JuliaFormatter](https://discourse.julialang.org/t/how-to-use-format-md-in-juliaformatter/117773)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 0\
**Last updated:** [August 2, 2024, 7:11pm UTC](https://discourse.julialang.org/t/how-to-use-format-md-in-juliaformatter/117773 "2024-08-02T19:11:56Z")

</div>

Hello, I would like to know how to use the function format\_md in JuliaFormatter. For example, how do I format markdown files used with Documenter.jl? Thank you.

---

## [Basic trigonometric simplifications in Symbolics.jl](https://discourse.julialang.org/t/basic-trigonometric-simplifications-in-symbolics-jl/99507)

<div class="topic-metadata">

**Author:** [@pr0physicist](https://discourse.julialang.org/u/pr0physicist)\
**Replies:** 1\
**Last updated:** [August 2, 2024, 6:07pm UTC](https://discourse.julialang.org/t/basic-trigonometric-simplifications-in-symbolics-jl/99507 "2024-08-02T18:07:35Z")

</div>

Julia: v1.9.0 Symbolics.jl: v5.3.1 Not sure if this is the intended behavior: using Symbolics @variables x simplify(sin(x) + sin(-x)) returns sin(x) + sin(-x) instead of 0, which is really surprising. Then checke…

---

## [Weird results while trying to measure allocation :/](https://discourse.julialang.org/t/weird-results-while-trying-to-measure-allocation/117745)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [August 2, 2024, 12:19am UTC](https://discourse.julialang.org/t/weird-results-while-trying-to-measure-allocation/117745 "2024-08-02T00:19:16Z")

</div>

Consider this Julia program: f() = Vector{Int}(undef, 128\*1024\*1024) (@timed f()).bytes (r = @timed f()); r.bytes Why do recent versions of Julia (v1.8 and up) evaluate the second line as 0? It really seems like the se…

---

## [How to write a function that outputs the linear combination of other functions?](https://discourse.julialang.org/t/how-to-write-a-function-that-outputs-the-linear-combination-of-other-functions/117740)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 10\
**Last updated:** [August 1, 2024, 9:40pm UTC](https://discourse.julialang.org/t/how-to-write-a-function-that-outputs-the-linear-combination-of-other-functions/117740 "2024-08-01T21:40:27Z")

</div>

I have a certain list of functions fs and coefficients cs with which I would like form a linear combination, e.g., I’d like to obtain the function (args...; kwargs...) -\> ( cs\[1\] \* f\[1\](args...; kwargs...) + ... …

---

## [LoadError: Couldn't find libpython PyCall](https://discourse.julialang.org/t/loaderror-couldnt-find-libpython-pycall/16074)

<div class="topic-metadata">

**Author:** [@MMalakhov](https://discourse.julialang.org/u/MMalakhov)\
**Replies:** 7\
**Last updated:** [August 1, 2024, 8:15pm UTC](https://discourse.julialang.org/t/loaderror-couldnt-find-libpython-pycall/16074 "2024-08-01T20:15:52Z")

</div>

I can’t build PyCall on linux mint 18.3 julia\> Pkg.build(“PyCall”) Building Conda ─→ ~/.julia/packages/Conda/hsaaN/deps/build.log Building PyCall → ~/.julia/packages/PyCall/rUul9/deps/build.log ┌ Error: Error buildi…

---

## [Makie: Fontsizes for Publications](https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721)

<div class="topic-metadata">

**Author:** [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Replies:** 4\
**Last updated:** [August 1, 2024, 10:37am UTC](https://discourse.julialang.org/t/makie-fontsizes-for-publications/117721 "2024-08-01T10:37:25Z")

</div>

Hey out there! I want to use CairoMakie.jl for my figures in a scientific work. The fontsize of the figure should match the fontsize of the text (12). I have found a reference on the Makie site discussion this issue. (…

---

## [Create a multicolor (gradient, palette) bar in Plots](https://discourse.julialang.org/t/create-a-multicolor-gradient-palette-bar-in-plots/117546)

<div class="topic-metadata">

**Author:** [@eotero](https://discourse.julialang.org/u/eotero)\
**Replies:** 3\
**Last updated:** [August 1, 2024, 7:52am UTC](https://discourse.julialang.org/t/create-a-multicolor-gradient-palette-bar-in-plots/117546 "2024-08-01T07:52:49Z")

</div>

In Julia is easy to assign a color to each bar with Julia Plots, but how can I combine colors for each bar, suppose I want to apply a kind of palette to fill the bar. Thanks.

---

## [Error when using @load after if statement](https://discourse.julialang.org/t/error-when-using-load-after-if-statement/117625)

<div class="topic-metadata">

**Author:** [@J\_B\_R](https://discourse.julialang.org/u/J_B_R)\
**Replies:** 2\
**Last updated:** [August 1, 2024, 7:28am UTC](https://discourse.julialang.org/t/error-when-using-load-after-if-statement/117625 "2024-08-01T07:28:34Z")

</div>

Hi there – I would like to write a code that loads all data of a file, but only in case this file exists. I use the @load function of JLD2. However, integrating @load into an if statement leads to an error if the file do…

---

## [Zygote.gradient does not work with AbstractGPs.CustomMean](https://discourse.julialang.org/t/zygote-gradient-does-not-work-with-abstractgps-custommean/87815)

<div class="topic-metadata">

**Author:** [@soldasim](https://discourse.julialang.org/u/soldasim)\
**Replies:** 9\
**Last updated:** [August 1, 2024, 6:06am UTC](https://discourse.julialang.org/t/zygote-gradient-does-not-work-with-abstractgps-custommean/87815 "2024-08-01T06:06:37Z")

</div>

Hello, I am trying to use an AbstractGPs.FiniteGP with Turing and I am having problems with Zygote.gradient calculation of the GP hyperparameters. For some reason, Zygote fails to calculate the gradient when using an Ab…

---

## [How one can evaluate @printf to be returned to a value](https://discourse.julialang.org/t/how-one-can-evaluate-printf-to-be-returned-to-a-value/117669)

<div class="topic-metadata">

**Author:** [@khaledharizb](https://discourse.julialang.org/u/khaledharizb)\
**Replies:** 7\
**Last updated:** [July 31, 2024, 6:16pm UTC](https://discourse.julialang.org/t/how-one-can-evaluate-printf-to-be-returned-to-a-value/117669 "2024-07-31T18:16:15Z")

</div>

Hi all, for a technical reason I would like to define functions as below. My problem is how to evaluate func(xx) to get a value function DeltaAI(z) return 1/(1+z) end function DeltaAII(z) return √(1-z^2) end if (F==0)…

---

## [Best way to generate vector of tuples based on two vectors](https://discourse.julialang.org/t/best-way-to-generate-vector-of-tuples-based-on-two-vectors/117687)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 4\
**Last updated:** [July 31, 2024, 5:58pm UTC](https://discourse.julialang.org/t/best-way-to-generate-vector-of-tuples-based-on-two-vectors/117687 "2024-07-31T17:58:21Z")

</div>

The following does what I want, generate a vector of tuples thanks to the two vectors that I provide. xycoordinates = Tuple{Int,Int}\[(x,y) for x in collect(1:10), y in rand(1:10, 10)\] I wanted to know if there exists a…

---

## [Anybody with a Mac who could help debugging CI failures?](https://discourse.julialang.org/t/anybody-with-a-mac-who-could-help-debugging-ci-failures/117668)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 8\
**Last updated:** [July 31, 2024, 5:28pm UTC](https://discourse.julialang.org/t/anybody-with-a-mac-who-could-help-debugging-ci-failures/117668 "2024-07-31T17:28:24Z")

</div>

We have an issue with CI failures on macOS with PackageCompiler.jl. This is actually an issue that dates back from last year. Could someone who has access to a Mac have a look: Fix CI failures on macOS · Issue #955 · Ju…

---

## [How to drop singleton dimensions in a type stable way?](https://discourse.julialang.org/t/how-to-drop-singleton-dimensions-in-a-type-stable-way/117653)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 8\
**Last updated:** [July 31, 2024, 7:39am UTC](https://discourse.julialang.org/t/how-to-drop-singleton-dimensions-in-a-type-stable-way/117653 "2024-07-31T07:39:25Z")

</div>

I have a 3D array A which is obtained by calculating a certain function over a grid specified by axes xs, ys and zs. These axes can be either an AbstractVector{Number} or a Number. When any of the axes is a Number, the c…

---

## [Is there a way to change the default CairoMakie.jl temp directory?](https://discourse.julialang.org/t/is-there-a-way-to-change-the-default-cairomakie-jl-temp-directory/117576)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 2\
**Last updated:** [July 29, 2024, 9:42pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-change-the-default-cairomakie-jl-temp-directory/117576 "2024-07-29T21:42:44Z")

</div>

I’m using Julia on my phone and so CairoMakie.jl can’t display plots directly, but it does save it to a temp directory. But this directory is very inconvenient since it’s buried under two VM layers (Android-\>termux-\>Ubun…

---

## [New failure to precompile](https://discourse.julialang.org/t/new-failure-to-precompile/117635)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 1\
**Last updated:** [July 30, 2024, 8:19pm UTC](https://discourse.julialang.org/t/new-failure-to-precompile/117635 "2024-07-30T20:19:15Z")

</div>

I’ve been away for three weeks. Now my script won’t work. I haven’t changed anything knowingly. #using Pkg #Pkg.instantiate() #Pkg.update() using GeoStats, GeoIO, CSV, DataFrames, Colors, ColorSchemes, PDFmerger gives …

---

## [GLMakie elements too small on hidipi screen](https://discourse.julialang.org/t/glmakie-elements-too-small-on-hidipi-screen/117649)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [July 30, 2024, 7:53pm UTC](https://discourse.julialang.org/t/glmakie-elements-too-small-on-hidipi-screen/117649 "2024-07-30T19:53:45Z")

</div>

In GLMakie on a 4k screen everything in my plot seems too small. I tried Figure(px\_per\_unit=16, pt\_per\_unit=16) but that didn’t do anything afaict.

---

## [Triggering CI run by release of a new pre-release Julia version?](https://discourse.julialang.org/t/triggering-ci-run-by-release-of-a-new-pre-release-julia-version/117646)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 0\
**Last updated:** [July 30, 2024, 7:03pm UTC](https://discourse.julialang.org/t/triggering-ci-run-by-release-of-a-new-pre-release-julia-version/117646 "2024-07-30T19:03:18Z")

</div>

see the post header :slight\_smile:

---

## [Saving/loading a neural network trained with NeuralPDE](https://discourse.julialang.org/t/saving-loading-a-neural-network-trained-with-neuralpde/117583)

<div class="topic-metadata">

**Author:** [@gradureau](https://discourse.julialang.org/u/gradureau)\
**Replies:** 3\
**Last updated:** [July 30, 2024, 4:42pm UTC](https://discourse.julialang.org/t/saving-loading-a-neural-network-trained-with-neuralpde/117583 "2024-07-30T16:42:39Z")

</div>

Hello everybody, I am using neuralPDE to train neural networks and I wish to save them in files to use them later. It works just fine if I use the standard Lux layers. Yet I wish to use the following custom layer at the…

---

## [RCall not working - package 'stats' not found](https://discourse.julialang.org/t/rcall-not-working-package-stats-not-found/93206)

<div class="topic-metadata">

**Author:** [@Danilo\_Carajiliascov](https://discourse.julialang.org/u/Danilo_Carajiliascov)\
**Replies:** 5\
**Last updated:** [July 30, 2024, 4:13pm UTC](https://discourse.julialang.org/t/rcall-not-working-package-stats-not-found/93206 "2024-07-30T16:13:17Z")

</div>

Hi, Everyone! Can someone help me with these errors, please? It was working yesterday at night and today mornig started to show the errors above :pensive: After loading package (“using RCall”) ┌ Warning: RCall.jl: Du…

---

## [Macro interpolation of Symbols without \`eval\`](https://discourse.julialang.org/t/macro-interpolation-of-symbols-without-eval/117603)

<div class="topic-metadata">

**Author:** [@joh](https://discourse.julialang.org/u/joh)\
**Replies:** 3\
**Last updated:** [July 30, 2024, 12:37pm UTC](https://discourse.julialang.org/t/macro-interpolation-of-symbols-without-eval/117603 "2024-07-30T12:37:57Z")

</div>

I am trying to write a macro for setting up a submodule in my package. Since this is called at precompile time, I cannot use eval (otherwise I get InitError: Evaluation into the closed module ImportEval breaks incrementa…

---

## [Macro with variable argument list combined with closure](https://discourse.julialang.org/t/macro-with-variable-argument-list-combined-with-closure/117623)

<div class="topic-metadata">

**Author:** [@nietzsche](https://discourse.julialang.org/u/nietzsche)\
**Replies:** 2\
**Last updated:** [July 30, 2024, 11:19am UTC](https://discourse.julialang.org/t/macro-with-variable-argument-list-combined-with-closure/117623 "2024-07-30T11:19:06Z")

</div>

Hi, i have a question about variable arguments in macros together with the scope of them. Function count\_test() should be a closure over the variable count and the lambda should be generated with a macro. It should b…

---

## [Type instability of empty \`Array\` with elemental types parameterized by \`UnionAll\`](https://discourse.julialang.org/t/type-instability-of-empty-array-with-elemental-types-parameterized-by-unionall/117618)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 1\
**Last updated:** [July 30, 2024, 5:14am UTC](https://discourse.julialang.org/t/type-instability-of-empty-array-with-elemental-types-parameterized-by-unionall/117618 "2024-07-30T05:14:43Z")

</div>

MWE: julia\> v1 = Tuple{AbstractVector{Float64}, Int64}\[\] Tuple{AbstractVector{Float64}, Int64}\[\] julia\> first.(v1) AbstractVector{Float64}\[\] julia\> v2 = Tuple{AbstractArray{Float64}, Int64}\[\] Tuple{AbstractArray{Float…

---

## [Parallel matrix col/row operations give incorrect results](https://discourse.julialang.org/t/parallel-matrix-col-row-operations-give-incorrect-results/117549)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 8\
**Last updated:** [July 29, 2024, 8:26pm UTC](https://discourse.julialang.org/t/parallel-matrix-col-row-operations-give-incorrect-results/117549 "2024-07-29T20:26:35Z")

</div>

When doing gaussian elimination in parallel, I noticed incorrect results when I pass tuples of several matrices: using LinearAlgebra function add\_col!(X::Matrix{tw}, w::tw, j1::Int, j2::Int) where {tw} for i=1:siz…

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

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