# General Usage

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

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

**Page:** 64

---

## [How to copy a dataframe column within the same dataframe?](https://discourse.julialang.org/t/how-to-copy-a-dataframe-column-within-the-same-dataframe/129136)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 4\
**Last updated:** [May 19, 2025, 9:44am UTC](https://discourse.julialang.org/t/how-to-copy-a-dataframe-column-within-the-same-dataframe/129136 "2025-05-19T09:44:14Z")

</div>

Hi, I would like to copy (not a view) a column of dataframe inside the same dataframe. E.g. to have: julia\> df = DataFrame(A=1:4, B=\["A", "B", "C", "D"\]) 4×2 DataFrame Row │ A B │ Int64 String ─────…

---

## [Julia vscode lose connection to REPL after a while](https://discourse.julialang.org/t/julia-vscode-lose-connection-to-repl-after-a-while/128879)

<div class="topic-metadata">

**Author:** [@AliceandBob](https://discourse.julialang.org/u/AliceandBob)\
**Replies:** 4\
**Last updated:** [May 19, 2025, 8:53am UTC](https://discourse.julialang.org/t/julia-vscode-lose-connection-to-repl-after-a-while/128879 "2025-05-19T08:53:42Z")

</div>

I am doing everything on my laptop with Julia+VSCode. Everything worked well until recently (maybe from 5 days before). By pressing Shift+Enter, it automatically opens a REPL at the bottom, and the left Julia panel show…

---

## [Compiler specialisation in automatic differentiation](https://discourse.julialang.org/t/compiler-specialisation-in-automatic-differentiation/129020)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 3\
**Last updated:** [May 19, 2025, 8:16am UTC](https://discourse.julialang.org/t/compiler-specialisation-in-automatic-differentiation/129020 "2025-05-19T08:16:46Z")

</div>

I am working with finite element method code. In this context, it is (very!!!) useful to use forward automatic differentiation to differentiate the function that, from degrees of freedom, compute the element’s contribut…

---

## [How to not import Base.isopen](https://discourse.julialang.org/t/how-to-not-import-base-isopen/128766)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 12\
**Last updated:** [May 18, 2025, 6:04pm UTC](https://discourse.julialang.org/t/how-to-not-import-base-isopen/128766 "2025-05-18T18:04:45Z")

</div>

I would like to write my own isopen function and therefore not import Base.isopen. I have thought of two ways to do this: module MyModule function isopen end # Lots of code... include("file\_that\_defines\_isopen.jl") en…

---

## [Prompts that do not accept the labeled responses nor the default](https://discourse.julialang.org/t/prompts-that-do-not-accept-the-labeled-responses-nor-the-default/129069)

<div class="topic-metadata">

**Author:** [@Buk](https://discourse.julialang.org/u/Buk)\
**Replies:** 5\
**Last updated:** [May 18, 2025, 4:23pm UTC](https://discourse.julialang.org/t/prompts-that-do-not-accept-the-labeled-responses-nor-the-default/129069 "2025-05-18T16:23:03Z")

</div>

Why does this happen? julia\> using Plots, Interact │ Packages \[Plots, Interact\] not found, but packages named \[Plots, Interact\] are available from a registry. │ Install packages? │ (@v1.12) pkg\> add Plots Interact …

---

## [REPL freezes without error](https://discourse.julialang.org/t/repl-freezes-without-error/129074)

<div class="topic-metadata">

**Author:** [@Buk](https://discourse.julialang.org/u/Buk)\
**Replies:** 12\
**Last updated:** [May 18, 2025, 8:55am UTC](https://discourse.julialang.org/t/repl-freezes-without-error/129074 "2025-05-18T08:55:35Z")

</div>

Pasting a short script into the REPL, it slowly accepts line after line but when it gets to the last line it just freezes there indefinitely. No errors. No cpu activity. no idication anything is wrong or failing iany de…

---

## [How to prevent unwanted "optimization" in SIMD code?](https://discourse.julialang.org/t/how-to-prevent-unwanted-optimization-in-simd-code/129081)

<div class="topic-metadata">

**Author:** [@lntricate](https://discourse.julialang.org/u/lntricate)\
**Replies:** 8\
**Last updated:** [May 18, 2025, 2:59am UTC](https://discourse.julialang.org/t/how-to-prevent-unwanted-optimization-in-simd-code/129081 "2025-05-18T02:59:48Z")

</div>

I’m working on writing a SIMD base64 encoding algorithm (from this paper), and I came across an annoying thing. Consider the following example method: function test\_mul(a::NTuple{16, VecElement{UInt16}}, b::NTuple{16, V…

---

## [Python is faster than Julia on Windows ARM64](https://discourse.julialang.org/t/python-is-faster-than-julia-on-windows-arm64/129105)

<div class="topic-metadata">

**Author:** [@bobmccrory](https://discourse.julialang.org/u/bobmccrory)\
**Replies:** 5\
**Last updated:** [May 17, 2025, 8:05pm UTC](https://discourse.julialang.org/t/python-is-faster-than-julia-on-windows-arm64/129105 "2025-05-17T20:05:12Z")

</div>

I ran a smoothed particle hydrodynamics simulation on my Windows ARM64 machine, a Windows Laptop 7. The Jullia version took 5 min 28 sec to run, while the Python version took 4m 19s. To check this, I ran the same progra…

---

## [Moving source code and packages to a secured environment](https://discourse.julialang.org/t/moving-source-code-and-packages-to-a-secured-environment/129068)

<div class="topic-metadata">

**Author:** [@SGHoekstra](https://discourse.julialang.org/u/SGHoekstra)\
**Replies:** 7\
**Last updated:** [May 17, 2025, 5:38pm UTC](https://discourse.julialang.org/t/moving-source-code-and-packages-to-a-secured-environment/129068 "2025-05-17T17:38:36Z")

</div>

Hey everyone, I need to move source code and a lot of packages to a secured environment where there is no internet. I have seen the options of SIEGE or PackageCompiler to move images to another system but this excludes …

---

## [Scope in functions](https://discourse.julialang.org/t/scope-in-functions/22096)

<div class="topic-metadata">

**Author:** [@alee](https://discourse.julialang.org/u/alee)\
**Replies:** 13\
**Last updated:** [May 17, 2025, 4:28am UTC](https://discourse.julialang.org/t/scope-in-functions/22096 "2025-05-17T04:28:40Z")

</div>

One of my collaborators found the following behaviour confusing. function foo() function bar() x = 3 return x end x = 1 bar() return x end foo() which outputs 3 (and not 1). This behaviour is differe…

---

## [Global scope confusion again](https://discourse.julialang.org/t/global-scope-confusion-again/20044)

<div class="topic-metadata">

**Author:** [@Paul](https://discourse.julialang.org/u/Paul)\
**Replies:** 52\
**Last updated:** [May 17, 2025, 4:13am UTC](https://discourse.julialang.org/t/global-scope-confusion-again/20044 "2025-05-17T04:13:28Z")

</div>

This code runs in JuliaBox (0.6.4), but running the code in JuliaPro on OSX Mojave the same code (cut and pasted) returns an error message (undefined variable a). I have the same problem both on my MacMini and my MacBook…

---

## [Animated simulation in GLMakie, launched from interface](https://discourse.julialang.org/t/animated-simulation-in-glmakie-launched-from-interface/129077)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [May 17, 2025, 12:48am UTC](https://discourse.julialang.org/t/animated-simulation-in-glmakie-launched-from-interface/129077 "2025-05-17T00:48:30Z")

</div>

I’m developing an educational tool where the student will follow a chemical reaction. The tool starts with this interface: When the student clicks Run, a cool animations (should) start, particles start bouncing and r…

---

## [Universal Differential Equations while also estimating non NN parameters](https://discourse.julialang.org/t/universal-differential-equations-while-also-estimating-non-nn-parameters/129075)

<div class="topic-metadata">

**Author:** [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Replies:** 1\
**Last updated:** [May 16, 2025, 8:18pm UTC](https://discourse.julialang.org/t/universal-differential-equations-while-also-estimating-non-nn-parameters/129075 "2025-05-16T20:18:34Z")

</div>

I have been using the the tutorial on Automatically Discover Missing Physics by Embedding Machine Learning into Differential Equations as a textbook to build my ODEs with embedded NN’s (It’s awesome). I also want to opti…

---

## [How to circumvent Intel's AMD discrimination in MKL from v1.7 onwards?](https://discourse.julialang.org/t/how-to-circumvent-intels-amd-discrimination-in-mkl-from-v1-7-onwards/105075)

<div class="topic-metadata">

**Author:** [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Replies:** 2\
**Last updated:** [May 16, 2025, 3:55pm UTC](https://discourse.julialang.org/t/how-to-circumvent-intels-amd-discrimination-in-mkl-from-v1-7-onwards/105075 "2025-05-16T15:55:32Z")

</div>

Hi everyone, I’ve been ending up having to compute a lot of large dense non-hermitian eigenproblems on an HPC cluster that uses AMD EPYC Milan CPUs. I thought I could use Intel MKL, since it usually does a better job fo…

---

## [Why is there no Regex Delim option in CSV.jl?](https://discourse.julialang.org/t/why-is-there-no-regex-delim-option-in-csv-jl/129062)

<div class="topic-metadata">

**Author:** [@consumere](https://discourse.julialang.org/u/consumere)\
**Replies:** 1\
**Last updated:** [May 16, 2025, 12:48pm UTC](https://discourse.julialang.org/t/why-is-there-no-regex-delim-option-in-csv-jl/129062 "2025-05-16T12:48:36Z")

</div>

I regularly ask myself why this is not implemented. CSV.read(filepath, DataFrame; delim="\\s+") i know that this works. CSV.read(filepath, DataFrame; delim=" ",stripwhitespace=true,ignorerepeated=true) and yes, it is …

---

## [How to get type stability across methods?](https://discourse.julialang.org/t/how-to-get-type-stability-across-methods/129046)

<div class="topic-metadata">

**Author:** [@akriegman](https://discourse.julialang.org/u/akriegman)\
**Replies:** 9\
**Last updated:** [May 16, 2025, 6:17am UTC](https://discourse.julialang.org/t/how-to-get-type-stability-across-methods/129046 "2025-05-16T06:17:11Z")

</div>

I have a program where I want to dynamically choose a function from a list and have the result be type stable. All the methods involved do return the same type, but it appears that past a certain number of methods the ty…

---

## [How to keep additional info from time evolution in OrdinaryDiffEq.jl?](https://discourse.julialang.org/t/how-to-keep-additional-info-from-time-evolution-in-ordinarydiffeq-jl/129060)

<div class="topic-metadata">

**Author:** [@svretina](https://discourse.julialang.org/u/svretina)\
**Replies:** 1\
**Last updated:** [May 16, 2025, 10:21am UTC](https://discourse.julialang.org/t/how-to-keep-additional-info-from-time-evolution-in-ordinarydiffeq-jl/129060 "2025-05-16T10:21:37Z")

</div>

I am evolving a statevector U and in my rhs function I return the dU vector. How can I keep the dU values to access after the time evolution? for example you have positiona and velocity in your statevector U = \[x,v\] t…

---

## [Multi Dimension Interpolation with Unitful](https://discourse.julialang.org/t/multi-dimension-interpolation-with-unitful/129043)

<div class="topic-metadata">

**Author:** [@luke-pikaart](https://discourse.julialang.org/u/luke-pikaart)\
**Replies:** 2\
**Last updated:** [May 15, 2025, 4:35pm UTC](https://discourse.julialang.org/t/multi-dimension-interpolation-with-unitful/129043 "2025-05-15T16:35:48Z")

</div>

I am trying to interpolate f : \\mathbb{R\_{units}} \\to \\mathbb{R\_{units}}^3 where there are unitful units on both the grid and the data. I found this example that showed me how to get f : \\mathbb{R} \\to \\mathbb{R}^3 in…

---

## [Mousetrap says screen not DRI3 capable](https://discourse.julialang.org/t/mousetrap-says-screen-not-dri3-capable/129023)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 2\
**Last updated:** [May 15, 2025, 2:53pm UTC](https://discourse.julialang.org/t/mousetrap-says-screen-not-dri3-capable/129023 "2025-05-15T14:53:17Z")

</div>

I’m starting a new project using Mousetrap, and I ran these commands to install it: pkg\> add https://github.com/clemapfel/mousetrap\_jll pkg\> add https://github.com/clemapfel/mousetrap.jl I got output ending like this: …

---

## [Space issue with the @. macro](https://discourse.julialang.org/t/space-issue-with-the-macro/129032)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 4\
**Last updated:** [May 15, 2025, 1:36pm UTC](https://discourse.julialang.org/t/space-issue-with-the-macro/129032 "2025-05-15T13:36:33Z")

</div>

Is this normal/documented ? julia\> x = 1 1 julia\> b = x -3 \* x^2 -2 julia\> x = \[1,2,3\] 3-element Vector{Int64}: 1 2 3 julia\> b = @. x - 3 \* x^2 3-element Vector{Int64}: -2 -10 -24 julia\> b = @. x -3 \* x^2 ERR…

---

## [Registrator broken?: Unexpected error in registration](https://discourse.julialang.org/t/registrator-broken-unexpected-error-in-registration/129026)

<div class="topic-metadata">

**Author:** [@srs](https://discourse.julialang.org/u/srs)\
**Replies:** 4\
**Last updated:** [May 15, 2025, 11:35am UTC](https://discourse.julialang.org/t/registrator-broken-unexpected-error-in-registration/129026 "2025-05-15T11:35:08Z")

</div>

Hey guys, registrator isn’t working. Is something down here? I tried both the web app and the github app and they both give me “Unexpected error in registration” (very helpful) The repo is this one, but it shouldn’t mat…

---

## [Faster way to peform rank-1 update to matrix inverse](https://discourse.julialang.org/t/faster-way-to-peform-rank-1-update-to-matrix-inverse/129001)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 5\
**Last updated:** [May 15, 2025, 9:10am UTC](https://discourse.julialang.org/t/faster-way-to-peform-rank-1-update-to-matrix-inverse/129001 "2025-05-15T09:10:45Z")

</div>

I want to update a matrix inverse using the Sherman-Morrison formula (A + uv’)^-1 = A^-1 - (A^-1 uv’ A^-1)/(1 + v’A^-1u) for a large non-sparse matrix inside a loop (a coordinate descent algorithm). Here is a minimum …

---

## [Custom serializer for arrays of Union types](https://discourse.julialang.org/t/custom-serializer-for-arrays-of-union-types/129016)

<div class="topic-metadata">

**Author:** [@Kirby\_Zhang](https://discourse.julialang.org/u/Kirby_Zhang)\
**Replies:** 2\
**Last updated:** [May 15, 2025, 4:08am UTC](https://discourse.julialang.org/t/custom-serializer-for-arrays-of-union-types/129016 "2025-05-15T04:08:59Z")

</div>

I’m looking to speed up serialization of arrays that allow for missing values. Performance falls by an order of magnitude according to the following test: N = Int(1e8); buffer = Vector{UInt8}(undef, 8 \* N); io = IOBu…

---

## [Faster \`findmin\` without LoopVectorization.jl](https://discourse.julialang.org/t/faster-findmin-without-loopvectorization-jl/121742)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 35\
**Last updated:** [May 14, 2025, 4:06pm UTC](https://discourse.julialang.org/t/faster-findmin-without-loopvectorization-jl/121742 "2025-05-14T16:06:48Z")

</div>

@graeme-a-stewart has this faster alternative of Base.findmin: julia\> using LoopVectorization, Chairmarks julia\> function fast\_findmin(dij, n) best = 1 @inbounds dij\_min = dij\[1\] @turbo…

---

## [Specialisation rules for function objects and type parameters](https://discourse.julialang.org/t/specialisation-rules-for-function-objects-and-type-parameters/128991)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 2\
**Last updated:** [May 14, 2025, 11:29am UTC](https://discourse.julialang.org/t/specialisation-rules-for-function-objects-and-type-parameters/128991 "2025-05-14T11:29:39Z")

</div>

The Julia docs say: I am wondering if this applies recursively or not? For example, struct Wrapper{F\<:Function} f::F end (w::Wrapper{F})(x) where {F} = w.f(x) f\_func(f, num) = ntuple(f, div(num, 2)) Would f\_func …

---

## [How to use monotonic interpolation instead of linear?](https://discourse.julialang.org/t/how-to-use-monotonic-interpolation-instead-of-linear/128958)

<div class="topic-metadata">

**Author:** [@dg.aragones](https://discourse.julialang.org/u/dg.aragones)\
**Replies:** 4\
**Last updated:** [May 14, 2025, 9:30am UTC](https://discourse.julialang.org/t/how-to-use-monotonic-interpolation-instead-of-linear/128958 "2025-05-14T09:30:15Z")

</div>

Hi everyone, I’ve been using a simple interpolation function like this: Φ(ϕ, t) = interpolate((0 : 7/length(ϕ) : 7,), vcat(0, ϕ), Gridded(Linear()))(t) This uses linear interpolation with Interpolations.jl, and it wor…

---

## [Raspberry PI 5 GPIO](https://discourse.julialang.org/t/raspberry-pi-5-gpio/126652)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 6\
**Last updated:** [May 13, 2025, 6:21pm UTC](https://discourse.julialang.org/t/raspberry-pi-5-gpio/126652 "2025-05-13T18:21:41Z")

</div>

I have an application that requires a trigger signal (Just one pin going from low to high and back to low). There are several options for GPIO control in Julia but the PI 5 adds a new twist as outlined here and here. T…

---

## [Some thoughts on improving the doc of SparseArrays.jl](https://discourse.julialang.org/t/some-thoughts-on-improving-the-doc-of-sparsearrays-jl/128960)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 1\
**Last updated:** [May 13, 2025, 1:29pm UTC](https://discourse.julialang.org/t/some-thoughts-on-improving-the-doc-of-sparsearrays-jl/128960 "2025-05-13T13:29:17Z")

</div>

The stdlib SparseArrays.jl is mainly about SparseMatrixCSC and SparseVector. From my point of view, its doc reads a bit immature (Edit: this word was used improperly. I hadn’t learnt its meaning. I’m not an native speak…

---

## [\[julia\] imshow() return a dict and no image in Visual Studio Code](https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953)

<div class="topic-metadata">

**Author:** [@watchben](https://discourse.julialang.org/u/watchben)\
**Replies:** 4\
**Last updated:** [May 13, 2025, 1:20pm UTC](https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953 "2025-05-13T13:20:26Z")

</div>

Hello dear community, I’m running this code in a jupyter notebook via Visual Studio Code: # Packages using Images, ImageView # Loading image from path img\_rgb = load(img\_path) # Compound function converting img to gray…

---

## [Python3+@njit faster than julia (rs)](https://discourse.julialang.org/t/python3-njit-faster-than-julia-rs/128932)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 10\
**Last updated:** [May 13, 2025, 1:08pm UTC](https://discourse.julialang.org/t/python3-njit-faster-than-julia-rs/128932 "2025-05-13T13:08:59Z")

</div>

Consider the simple following test: julia\> using Chairmarks julia\> function test(f, m) size = length(f) for i in 1:size for j in 1:size dij = m\[i,j\] …

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

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