# General Usage

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

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

**Page:** 485

---

## [Julian methods for batched computations without loops](https://discourse.julialang.org/t/julian-methods-for-batched-computations-without-loops/76201)

<div class="topic-metadata">

**Author:** [@harwiltz](https://discourse.julialang.org/u/harwiltz)\
**Replies:** 5\
**Last updated:** [February 11, 2022, 2:57pm UTC](https://discourse.julialang.org/t/julian-methods-for-batched-computations-without-loops/76201 "2022-02-11T14:57:34Z")

</div>

Hi all, I’m fairly new to Julia, coming from Python + JAX. As such, I’ve become accustomed to writing vectorized expressions to avoid expensive for loops – however, I understand that this isn’t something that should be …

---

## [@everywhere takes a very long time when using a cluster](https://discourse.julialang.org/t/everywhere-takes-a-very-long-time-when-using-a-cluster/35724)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 16\
**Last updated:** [February 11, 2022, 2:47pm UTC](https://discourse.julialang.org/t/everywhere-takes-a-very-long-time-when-using-a-cluster/35724 "2022-02-11T14:47:32Z")

</div>

I think I’ve found a bug with @everywhere on 1.3 but it’s hard to reproduce. Basically, it takes very long to load the package when using a cluster with multiple nodes (workload manager is Slurm). See the following resu…

---

## [Current REPL number](https://discourse.julialang.org/t/current-repl-number/76240)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 6\
**Last updated:** [February 11, 2022, 1:22pm UTC](https://discourse.julialang.org/t/current-repl-number/76240 "2022-02-11T13:22:44Z")

</div>

Does Julia provide an API for extracting the current REPL number? By “current REPL number”, I mean the x in REPL\[x\] in error messages like the following: julia\> error() ERROR: Stacktrace: \[1\] error() @ Base ./erro…

---

## [String compression on windows](https://discourse.julialang.org/t/string-compression-on-windows/69585)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 17\
**Last updated:** [February 11, 2022, 11:03am UTC](https://discourse.julialang.org/t/string-compression-on-windows/69585 "2022-02-11T11:03:38Z")

</div>

Hi all :slight\_smile: I’m forced to use windows. Is there any string compression pkg that can be used on windows? (like https://github.com/ararslan/Shoco.jl) Thank you!

---

## [Function arguments variable](https://discourse.julialang.org/t/function-arguments-variable/76208)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 1\
**Last updated:** [February 11, 2022, 11:25am UTC](https://discourse.julialang.org/t/function-arguments-variable/76208 "2022-02-11T11:25:06Z")

</div>

Is there a variable within a function that will return all function arguments as a named tuple (or something similar). Would be useful when calling a second function, that uses a similar set of arguments. f2(; a,b,c ) =…

---

## [@from (from Fromfile) does not work inside begin-en for local module workflow](https://discourse.julialang.org/t/from-from-fromfile-does-not-work-inside-begin-en-for-local-module-workflow/76100)

<div class="topic-metadata">

**Author:** [@jdad](https://discourse.julialang.org/u/jdad)\
**Replies:** 4\
**Last updated:** [February 11, 2022, 7:58am UTC](https://discourse.julialang.org/t/from-from-fromfile-does-not-work-inside-begin-en-for-local-module-workflow/76100 "2022-02-11T07:58:14Z")

</div>

I have been trying to get my “local modules” workflow from previous {either include or push loadpath} to using excellent @Roger-luo FromFile. But the case I was using it get me trouble, specifically it fails when include…

---

## [Is a package to trawl through the files in a package/folder and surface all the packages used within?](https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 4\
**Last updated:** [February 11, 2022, 6:21am UTC](https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929 "2022-02-11T06:21:12Z")

</div>

R’s renv has a function called renv::init() which does that. Also, for bonus points, is there a package to automatically put bounds on the Project.toml for each package that is used?

---

## [Replacing one value in a large csv of floats with a string](https://discourse.julialang.org/t/replacing-one-value-in-a-large-csv-of-floats-with-a-string/76197)

<div class="topic-metadata">

**Author:** [@mikel8](https://discourse.julialang.org/u/mikel8)\
**Replies:** 1\
**Last updated:** [February 11, 2022, 12:06am UTC](https://discourse.julialang.org/t/replacing-one-value-in-a-large-csv-of-floats-with-a-string/76197 "2022-02-11T00:06:23Z")

</div>

Hey all, I am trying to write a single string to one cell in a large CSV made up entirely of numbers Julia reads in as Floats when copying the CSV into a dataframe. I want to overwrite one value within the csv with a str…

---

## [Unexpected allocation when calling Julia function from C++](https://discourse.julialang.org/t/unexpected-allocation-when-calling-julia-function-from-c/76184)

<div class="topic-metadata">

**Author:** [@victor-shepardson](https://discourse.julialang.org/u/victor-shepardson)\
**Replies:** 0\
**Last updated:** [February 10, 2022, 5:17pm UTC](https://discourse.julialang.org/t/unexpected-allocation-when-calling-julia-function-from-c/76184 "2022-02-10T17:17:06Z")

</div>

Hey, I’m using PackageCompiler to make a shared library and calling it from C++ with the Julia GC turned off, allocating all memory on the C++ side. From the Julia side, I see 0 allocations: julia\> using BenchmarkTools…

---

## [Shade area under the curve between two points in Plots.jl](https://discourse.julialang.org/t/shade-area-under-the-curve-between-two-points-in-plots-jl/76190)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 3\
**Last updated:** [February 10, 2022, 9:31pm UTC](https://discourse.julialang.org/t/shade-area-under-the-curve-between-two-points-in-plots-jl/76190 "2022-02-10T21:31:19Z")

</div>

Hi all, I was wondering if it is possible to shade the area under the curve in Plots.jl? For example, can I adapt the code below to shade the area between -1 and 1? Thanks! using Plots, Distributions x = range(-3, 3…

---

## [Creating variables from file](https://discourse.julialang.org/t/creating-variables-from-file/76179)

<div class="topic-metadata">

**Author:** [@jvaes](https://discourse.julialang.org/u/jvaes)\
**Replies:** 9\
**Last updated:** [February 10, 2022, 7:49pm UTC](https://discourse.julialang.org/t/creating-variables-from-file/76179 "2022-02-10T19:49:36Z")

</div>

Hi everyone, I am designing a large model that has a lot of parameters that will be imported from a file. I can load the file in a dictionary and I would like to define the variables corresponding to each one of these …

---

## [Is there a static checking tool for Julia?](https://discourse.julialang.org/t/is-there-a-static-checking-tool-for-julia/22271)

<div class="topic-metadata">

**Author:** [@Gu\_Junhua](https://discourse.julialang.org/u/Gu_Junhua)\
**Replies:** 10\
**Last updated:** [February 10, 2022, 7:44pm UTC](https://discourse.julialang.org/t/is-there-a-static-checking-tool-for-julia/22271 "2022-02-10T19:44:01Z")

</div>

It is annoying that a program only report errors (e.g., no method matching …) when it reach the point of calling, especially for some time-consuming programs. Since in Julia, we can give detailed type information, I won…

---

## [Gnuplot ranges: how to set](https://discourse.julialang.org/t/gnuplot-ranges-how-to-set/76186)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [February 10, 2022, 6:36pm UTC](https://discourse.julialang.org/t/gnuplot-ranges-how-to-set/76186 "2022-02-10T18:36:30Z")

</div>

This one has got me stumped. When I don’t set the ranges explicitly, I get When I do, I get this: The code: # comment out the following two lines NOT to set the range explicitly @gp :- "set xrange…

---

## [Delete Id from dataframe if variable of id contains particular value](https://discourse.julialang.org/t/delete-id-from-dataframe-if-variable-of-id-contains-particular-value/76157)

<div class="topic-metadata">

**Author:** [@sai\_matcha](https://discourse.julialang.org/u/sai_matcha)\
**Replies:** 6\
**Last updated:** [February 10, 2022, 4:11pm UTC](https://discourse.julialang.org/t/delete-id-from-dataframe-if-variable-of-id-contains-particular-value/76157 "2022-02-10T16:11:04Z")

</div>

hi i want create a new dataframe by deleting some ids from the original data frame on condition. data frame i have df = DataFrame() df.id = repeat(1:3,3) df.v1 = 1:9 df.v2 = 20:28 sort!(df,:id) i want to delete total …

---

## [Convert date format "dd\_mm\_yyyy" in dataframe to "dd/mm/yyyy"](https://discourse.julialang.org/t/convert-date-format-dd-mm-yyyy-in-dataframe-to-dd-mm-yyyy/76033)

<div class="topic-metadata">

**Author:** [@agatheLG](https://discourse.julialang.org/u/agatheLG)\
**Replies:** 6\
**Last updated:** [February 10, 2022, 2:26pm UTC](https://discourse.julialang.org/t/convert-date-format-dd-mm-yyyy-in-dataframe-to-dd-mm-yyyy/76033 "2022-02-10T14:26:35Z")

</div>

Hi, I am trying to convert all the values of the columns of my dataframe which are Dates.Date type from format “dd\_mm\_yyyy” to “dd/mm/yyyy” I tried a lot of things like Dates.format.(Date(my\_dataframe\[:,:Date\_de\_naiss…

---

## [How to reference a variable within a struct](https://discourse.julialang.org/t/how-to-reference-a-variable-within-a-struct/76135)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 5\
**Last updated:** [February 10, 2022, 2:02pm UTC](https://discourse.julialang.org/t/how-to-reference-a-variable-within-a-struct/76135 "2022-02-10T14:02:57Z")

</div>

I understand that Julia doesn’t have “pointers” in the way that C++ does. However, I have stumbled upon an instance in which I feel like I really need something like a pointer that can refer to a variable from within a s…

---

## [Failed to install Interact, DiffEqFlux & Symbolics on 1.7.2](https://discourse.julialang.org/t/failed-to-install-interact-diffeqflux-symbolics-on-1-7-2/76036)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 16\
**Last updated:** [February 10, 2022, 1:54pm UTC](https://discourse.julialang.org/t/failed-to-install-interact-diffeqflux-symbolics-on-1-7-2/76036 "2022-02-10T13:54:39Z")

</div>

Three packages that did not install for v1.7.2 (out of a long list): Interact DiffEqFlux Symbolics Anyone with similar experience? \[Windows 11, 64bit, latest version.\]

---

## [Odd behaviour of custom labels in Plot recipes](https://discourse.julialang.org/t/odd-behaviour-of-custom-labels-in-plot-recipes/76057)

<div class="topic-metadata">

**Author:** [@GoodDayToYouAll](https://discourse.julialang.org/u/GoodDayToYouAll)\
**Replies:** 11\
**Last updated:** [February 10, 2022, 1:44pm UTC](https://discourse.julialang.org/t/odd-behaviour-of-custom-labels-in-plot-recipes/76057 "2022-02-10T13:44:05Z")

</div>

Hello everyone, I am very new to this forum as this is my first question here. I try to follow the guidelines for posting questions, but please point out any mistakes I do in this regard. To my question: I want to plot…

---

## [Where is the right place to put default settings for Plots.jl](https://discourse.julialang.org/t/where-is-the-right-place-to-put-default-settings-for-plots-jl/76149)

<div class="topic-metadata">

**Author:** [@Fred\_He](https://discourse.julialang.org/u/Fred_He)\
**Replies:** 9\
**Last updated:** [February 10, 2022, 1:32pm UTC](https://discourse.julialang.org/t/where-is-the-right-place-to-put-default-settings-for-plots-jl/76149 "2022-02-10T13:32:23Z")

</div>

I would like to set the default plotting style, e.g., default(grid=:off, box=:on)， when using Plots.jl to avoid doing it every time when I need to use it. putting it in startup.jl doesn’t work as an error occurs. So whe…

---

## [Interactive testing and test-specific dependencies](https://discourse.julialang.org/t/interactive-testing-and-test-specific-dependencies/76151)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [February 10, 2022, 1:17pm UTC](https://discourse.julialang.org/t/interactive-testing-and-test-specific-dependencies/76151 "2022-02-10T13:17:29Z")

</div>

I do not understand how test-specific dependencies are meant to be used in interactive work. To make this concrete, suppose that package Foo has using Foo using Test using Bar in test/runtests.jl. There is also a tes…

---

## [Taking variable as independent with Zygote (Automatic differentiation)](https://discourse.julialang.org/t/taking-variable-as-independent-with-zygote-automatic-differentiation/76159)

<div class="topic-metadata">

**Author:** [@Eriklw](https://discourse.julialang.org/u/Eriklw)\
**Replies:** 1\
**Last updated:** [February 10, 2022, 12:36pm UTC](https://discourse.julialang.org/t/taking-variable-as-independent-with-zygote-automatic-differentiation/76159 "2022-02-10T12:36:05Z")

</div>

I have a function that I want to take the gradient of in the end. I want to achive that a certain variable is deemed independent of the variable i wish to differentiate in the the end. I tried to do this with the Zygote.…

---

## [Allocation in broadcasting of round for staticarrays](https://discourse.julialang.org/t/allocation-in-broadcasting-of-round-for-staticarrays/76143)

<div class="topic-metadata">

**Author:** [@Jae-Mo\_Lihm](https://discourse.julialang.org/u/Jae-Mo_Lihm)\
**Replies:** 3\
**Last updated:** [February 10, 2022, 11:36am UTC](https://discourse.julialang.org/t/allocation-in-broadcasting-of-round-for-staticarrays/76143 "2022-02-10T11:36:51Z")

</div>

Why does the round.(Int, x::SVector) allocate? using BenchmarkTools, StaticArrays x = SVector{2}(\[0., 1.\]) @btime round.(Int, $x) # 21.180 ns (1 allocation: 16 bytes) @btime round.(Int, $(x.data)) # 6.451 ns (0 allocat…

---

## [Julia version lower bound for new manifest format](https://discourse.julialang.org/t/julia-version-lower-bound-for-new-manifest-format/76152)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 4\
**Last updated:** [February 10, 2022, 10:57am UTC](https://discourse.julialang.org/t/julia-version-lower-bound-for-new-manifest-format/76152 "2022-02-10T10:57:28Z")

</div>

If a package wants to use the new manifest format, what’s the lower bound for the Julia version? Some discussions suggests that backporting it to 1.6 was planned, but I could not find it.

---

## [Julia nightly downloads seem outdated](https://discourse.julialang.org/t/julia-nightly-downloads-seem-outdated/76146)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [February 10, 2022, 9:17am UTC](https://discourse.julialang.org/t/julia-nightly-downloads-seem-outdated/76146 "2022-02-10T09:17:34Z")

</div>

Just downloaded the nightly build from the official download link, and I find (base) jishnu:Downloads/ $ wget https://julialangnightlies-s3.julialang.org/bin/linux/x64/julia-latest-linux64.tar.gz --2022-02-10 11:13:27--…

---

## [Syntax of exchanging values of 2 variables seems to be broken in short-circuit evaluation](https://discourse.julialang.org/t/syntax-of-exchanging-values-of-2-variables-seems-to-be-broken-in-short-circuit-evaluation/76125)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 5\
**Last updated:** [February 10, 2022, 6:26am UTC](https://discourse.julialang.org/t/syntax-of-exchanging-values-of-2-variables-seems-to-be-broken-in-short-circuit-evaluation/76125 "2022-02-10T06:26:54Z")

</div>

Tested on Julia 1.7.2: julia\> t1 = rand(4) 4-element Vector{Float64}: 0.8846483727403565 0.5933843798087087 0.23231684762850824 0.6599451690863327 julia\> t2 = rand(5) 5-element Vector{Float64}: 0.9708033624024174 …

---

## [In-place multiplication is too much slower for ComplexF64](https://discourse.julialang.org/t/in-place-multiplication-is-too-much-slower-for-complexf64/75887)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 19\
**Last updated:** [February 10, 2022, 2:29am UTC](https://discourse.julialang.org/t/in-place-multiplication-is-too-much-slower-for-complexf64/75887 "2022-02-10T02:29:46Z")

</div>

The ordinary version: using BenchmarkTools const p = 60 const dd=randn(p,p) const ψ=randn(p,p\*p)+im\*randn(p,p\*p) function d2x(ψ::Array{ComplexF64,2})::Array{ComplexF64,2} ψr=dd\*ψ return ψr end @btime d2x(ψ); …

---

## [Learning testing in Julia by practice, propositions?](https://discourse.julialang.org/t/learning-testing-in-julia-by-practice-propositions/75855)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 19\
**Last updated:** [February 9, 2022, 11:43pm UTC](https://discourse.julialang.org/t/learning-testing-in-julia-by-practice-propositions/75855 "2022-02-09T23:43:58Z")

</div>

I want to learn testing Julia code and the best way to do this that I see, I find some untested project and try to write test for it. I can’t promise anything, my spare time is quite fluid thing, but I search for some go…

---

## [Compile fails on 1.7.2](https://discourse.julialang.org/t/compile-fails-on-1-7-2/76119)

<div class="topic-metadata">

**Author:** [@JackStrauss](https://discourse.julialang.org/u/JackStrauss)\
**Replies:** 2\
**Last updated:** [February 9, 2022, 9:38pm UTC](https://discourse.julialang.org/t/compile-fails-on-1-7-2/76119 "2022-02-09T21:38:56Z")

</div>

Hi I just downloaded 1.7.2 and started by making an image, and it gives a warning. Any idea what this means? This is on an Intel mac \[ Info: PackageCompiler: Done :heavy\_check\_mark: \[04m:10s\] PackageCompiler: compilin…

---

## [Assign types to a Dict returned by PyCall](https://discourse.julialang.org/t/assign-types-to-a-dict-returned-by-pycall/76113)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 5\
**Last updated:** [February 9, 2022, 9:26pm UTC](https://discourse.julialang.org/t/assign-types-to-a-dict-returned-by-pycall/76113 "2022-02-09T21:26:50Z")

</div>

I’m attempting to call a Python function from Julia which returns a dictionary with known types. I’d like to efficiently get a Julia dictionary with these correct types. It seems like there should be a way to provide th…

---

## [How to use MAXLOC(ARRAY, DIM , MASK \[,KIND\] \[,BACK\]) function in Julia?](https://discourse.julialang.org/t/how-to-use-maxloc-array-dim-mask-kind-back-function-in-julia/76107)

<div class="topic-metadata">

**Author:** [@aksahoo](https://discourse.julialang.org/u/aksahoo)\
**Replies:** 0\
**Last updated:** [February 9, 2022, 6:40pm UTC](https://discourse.julialang.org/t/how-to-use-maxloc-array-dim-mask-kind-back-function-in-julia/76107 "2022-02-09T18:40:36Z")

</div>

I did find the argmax function of julia but it does not consider the mask option of the MAXLOC function of fortran. Please suggest how to find the location of maximum value of matrix with the mask. Or how to call the m…

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

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