# General Usage

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

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

**Page:** 30

---

## [Extrema(x,dims=1) and NaNs](https://discourse.julialang.org/t/extrema-x-dims-1-and-nans/73764)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 11\
**Last updated:** [November 20, 2025, 7:46pm UTC](https://discourse.julialang.org/t/extrema-x-dims-1-and-nans/73764 "2025-11-20T19:46:04Z")

</div>

It seems extrema(x,dims=1) silently drops NaNs - and I cannot find that documented. (As a reference, minimum does not.) Did I miss something? Example x = \[1,NaN,3\] println(extrema(x)) println(extrema(x,dims=1)) gives …

---

## [Root package in the tree of outdated packages](https://discourse.julialang.org/t/root-package-in-the-tree-of-outdated-packages/133997)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 6\
**Last updated:** [November 20, 2025, 4:08pm UTC](https://discourse.julialang.org/t/root-package-in-the-tree-of-outdated-packages/133997 "2025-11-20T16:08:32Z")

</div>

How do I find the one package that holds everything back? (examples) pkg\> status --outdated -m Status \`C:\\Users\\pkonl\\Documents\\zzWIP\\FinEtoolsDeforLinear.jl\\examples\\Manifest.toml\` ⌅ \[ec485272\] ArnoldiMethod v0.2.0 (\<v…

---

## [Issue with FMU Export after Manipulating Model in Julia](https://discourse.julialang.org/t/issue-with-fmu-export-after-manipulating-model-in-julia/121084)

<div class="topic-metadata">

**Author:** [@CurioMath](https://discourse.julialang.org/u/CurioMath)\
**Replies:** 8\
**Last updated:** [November 20, 2025, 8:50am UTC](https://discourse.julialang.org/t/issue-with-fmu-export-after-manipulating-model-in-julia/121084 "2025-11-20T08:50:34Z")

</div>

Hi everyone, I am trying to export an FMU in Julia after importing and manipulating an FMU model. Specifically, I followed the example for manipulation from the documentation of FMIExport.jl, which can be found here: M…

---

## [Julia's Interaction with Foreign Threads](https://discourse.julialang.org/t/julias-interaction-with-foreign-threads/133888)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 1\
**Last updated:** [November 20, 2025, 4:04am UTC](https://discourse.julialang.org/t/julias-interaction-with-foreign-threads/133888 "2025-11-20T04:04:28Z")

</div>

In my use case, I’m creating a Julia library for Julia code to interact with Rust code. It has 3 types of threads: Threads created by Julia, which can handle foreign objects via ForeignType Threads created by Rust, whi…

---

## [\`MethodError\` when trying to \`filter\` a \`GroupedDataframe\`](https://discourse.julialang.org/t/methoderror-when-trying-to-filter-a-groupeddataframe/133996)

<div class="topic-metadata">

**Author:** [@Quantodeluz](https://discourse.julialang.org/u/Quantodeluz)\
**Replies:** 5\
**Last updated:** [November 20, 2025, 2:52am UTC](https://discourse.julialang.org/t/methoderror-when-trying-to-filter-a-groupeddataframe/133996 "2025-11-20T02:52:24Z")

</div>

I’m trying to filter the SubDataFrames with less than a given length (nrow) out of a GroupedDataFrame, but filter() doesn’t seem to recognize the anonymus function i’m passing to it and throws a MethodError: ERROR: Load…

---

## [Need memory and/or parallel optimization for pairwise distance metrics](https://discourse.julialang.org/t/need-memory-and-or-parallel-optimization-for-pairwise-distance-metrics/133943)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 25\
**Last updated:** [November 19, 2025, 8:17pm UTC](https://discourse.julialang.org/t/need-memory-and-or-parallel-optimization-for-pairwise-distance-metrics/133943 "2025-11-19T20:17:51Z")

</div>

I have a ~1000x800,000 sparse matrix, and I would like to calculate pairwise distance metrics for the columns. The vast majority of these will have distance 1, so I thought that I might store them as similarity (1 - dist…

---

## [Simplification in Symbolics v7](https://discourse.julialang.org/t/simplification-in-symbolics-v7/133974)

<div class="topic-metadata">

**Author:** [@bernardofpc](https://discourse.julialang.org/u/bernardofpc)\
**Replies:** 1\
**Last updated:** [November 19, 2025, 3:55pm UTC](https://discourse.julialang.org/t/simplification-in-symbolics-v7/133974 "2025-11-19T15:55:58Z")

</div>

I have read Basic expression manipulation with Symbolics.jl - #2 by Gravlax but found no issue, so I’m asking again with some very simple examples to understand if there is a reason for the three results below: julia\> s…

---

## [Weird bug that shouldn't happen; Cannot declare anonymous.#XX#XX constant; it already has a value](https://discourse.julialang.org/t/weird-bug-that-shouldnt-happen-cannot-declare-anonymous-xx-xx-constant-it-already-has-a-value/133989)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 2\
**Last updated:** [November 19, 2025, 2:58pm UTC](https://discourse.julialang.org/t/weird-bug-that-shouldnt-happen-cannot-declare-anonymous-xx-xx-constant-it-already-has-a-value/133989 "2025-11-19T14:58:28Z")

</div>

I was just playing around in Infiltrator and stumbled on this: Shouldn’t this be impossible? I have 2 other anonymous functions used in the script. Probably dozens if not hundreds in the packages I’m using. Couldn’…

---

## [REPL.LineEditREPL isn't a LineEditREPL](https://discourse.julialang.org/t/repl-lineeditrepl-isnt-a-lineeditrepl/133977)

<div class="topic-metadata">

**Author:** [@BC\_Arrr](https://discourse.julialang.org/u/BC_Arrr)\
**Replies:** 2\
**Last updated:** [November 19, 2025, 2:10pm UTC](https://discourse.julialang.org/t/repl-lineeditrepl-isnt-a-lineeditrepl/133977 "2025-11-19T14:10:06Z")

</div>

I can’t for the life of me figure out where things have gone wrong. I assume that multiple references to REPL exist and lead to the following errors: $ julia \_ \_ \_ \_(\_)\_ | Documentation: htt…

---

## [Questions about running a workshop](https://discourse.julialang.org/t/questions-about-running-a-workshop/133910)

<div class="topic-metadata">

**Author:** [@amca01](https://discourse.julialang.org/u/amca01)\
**Replies:** 3\
**Last updated:** [November 19, 2025, 12:52pm UTC](https://discourse.julialang.org/t/questions-about-running-a-workshop/133910 "2025-11-19T12:52:07Z")

</div>

Hello, I am a co-chair of an international conference in mathematics & technology to be held in December. In an unguided moment, I breezily offered to run a one hour workshop on Julia, especially emphasizing its speed …

---

## [Remove memory from Julia's management](https://discourse.julialang.org/t/remove-memory-from-julias-management/133983)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 2\
**Last updated:** [November 19, 2025, 12:19pm UTC](https://discourse.julialang.org/t/remove-memory-from-julias-management/133983 "2025-11-19T12:19:01Z")

</div>

When calling into Julia and using it as a library, is it possible to remove an allocated datum from Julia’s management? My use case is this: I have a Julia function, passed across FFI as a callback, which creates data b…

---

## [Taylor series from symbolics uses wrong rational approximations](https://discourse.julialang.org/t/taylor-series-from-symbolics-uses-wrong-rational-approximations/133971)

<div class="topic-metadata">

**Author:** [@bernardofpc](https://discourse.julialang.org/u/bernardofpc)\
**Replies:** 6\
**Last updated:** [November 19, 2025, 8:11am UTC](https://discourse.julialang.org/t/taylor-series-from-symbolics-uses-wrong-rational-approximations/133971 "2025-11-19T08:11:14Z")

</div>

I am calculating a Taylor series and I get strange rational numbers where they should not appear. A minimal example is the following: pkg\> st Status \[REDACTED\] \[163ba53b\] DiffResults v1.1.0 \[f6369f11\] ForwardDiff v…

---

## [GEMM kernel, cache oblivious, and Strassen](https://discourse.julialang.org/t/gemm-kernel-cache-oblivious-and-strassen/126527)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 5\
**Last updated:** [November 19, 2025, 5:18am UTC](https://discourse.julialang.org/t/gemm-kernel-cache-oblivious-and-strassen/126527 "2025-11-19T05:18:07Z")

</div>

I think many people are curious about how a GEMM kernel written in pure Julia can be much more performant than a naively written one. One can inspect the source code of LoopVectorization.jl, of course, or even the more p…

---

## [StackOverflowError after only 14 calls to the same function?](https://discourse.julialang.org/t/stackoverflowerror-after-only-14-calls-to-the-same-function/133693)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 4\
**Last updated:** [November 18, 2025, 8:29pm UTC](https://discourse.julialang.org/t/stackoverflowerror-after-only-14-calls-to-the-same-function/133693 "2025-11-18T20:29:35Z")

</div>

How many times does a function have to be called before a StackOverflowError is triggered? When I try with a simple recursive function call, it seems to be about 80,000. However, in my program, I have a function that is …

---

## [Read stdout/stderr from subprocess asynchronously](https://discourse.julialang.org/t/read-stdout-stderr-from-subprocess-asynchronously/133893)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 1\
**Last updated:** [November 18, 2025, 7:55pm UTC](https://discourse.julialang.org/t/read-stdout-stderr-from-subprocess-asynchronously/133893 "2025-11-18T19:55:28Z")

</div>

I want to call a process that might write to its stdout or stderr however it chooses. The process could take a while, and it might die (exit with nonzero status). Conceptually, I want something like this: cmd = \`sh -c…

---

## [Help defining a custom IBMFloat32 primitive type](https://discourse.julialang.org/t/help-defining-a-custom-ibmfloat32-primitive-type/133904)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 34\
**Last updated:** [November 18, 2025, 6:14pm UTC](https://discourse.julialang.org/t/help-defining-a-custom-ibmfloat32-primitive-type/133904 "2025-11-18T18:14:45Z")

</div>

I need to consume binary data from an old file format that uses 4-byte IBM floating point as opposed to IEEE floating point (i.e., Float32). The 4-byte IBM floating point type is also known as IBM HFP (hexadecimal floati…

---

## [Shorthand for ((i-1)\*k+1):(i\*k)](https://discourse.julialang.org/t/shorthand-for-i-1-k-1-i-k/133968)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 5\
**Last updated:** [November 18, 2025, 2:49pm UTC](https://discourse.julialang.org/t/shorthand-for-i-1-k-1-i-k/133968 "2025-11-18T14:49:35Z")

</div>

I often run into the problem of partitioning data to into equal “chunks”, eg a vector of N\*K elements into N chunks of K, then doing something to each chunk. As an MWE, consider z = zeros(N\*K) for i in 1:N z\[((i-1)\*…

---

## [Line search in LBFGSB package](https://discourse.julialang.org/t/line-search-in-lbfgsb-package/133949)

<div class="topic-metadata">

**Author:** [@Xu\_Shan](https://discourse.julialang.org/u/Xu_Shan)\
**Replies:** 3\
**Last updated:** [November 18, 2025, 11:00am UTC](https://discourse.julialang.org/t/line-search-in-lbfgsb-package/133949 "2025-11-18T11:00:09Z")

</div>

Hi guys, I am using LBFGSB package to optimize my problem (see below the message). However, I don’t understand the ABNORMAL\_TERMINATION\_IN\_LINSEARCH flag it threw to me at the final point…why is that? julia\> x0 = Cdoub…

---

## [Syntax error in an array expression](https://discourse.julialang.org/t/syntax-error-in-an-array-expression/22607)

<div class="topic-metadata">

**Author:** [@vvjn](https://discourse.julialang.org/u/vvjn)\
**Replies:** 6\
**Last updated:** [November 18, 2025, 10:19am UTC](https://discourse.julialang.org/t/syntax-error-in-an-array-expression/22607 "2025-11-18T10:19:22Z")

</div>

I ran the following code A = rand(2,3); A\[1, 2 +1 \] and I got this error ERROR: syntax: missing separator in array expression. Same error with i=2; A\[1, i +1\], which is how I came across this. Of course, A\[1,2+1\] works …

---

## [Method ambiguity involving diagonal types](https://discourse.julialang.org/t/method-ambiguity-involving-diagonal-types/133907)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 10\
**Last updated:** [November 18, 2025, 8:53am UTC](https://discourse.julialang.org/t/method-ambiguity-involving-diagonal-types/133907 "2025-11-18T08:53:59Z")

</div>

MWE: julia\> f1(argL::T, argR::T) where {T} = 1 f1 (generic function with 1 method) julia\> f1(argL::T1, argR::T2) where {T, T1\<:AbstractArray{T}, T2\<:AbstractArray{T}} = 2 f1 (generic function with 2 methods) julia\> f1…

---

## [Scanf Problem](https://discourse.julialang.org/t/scanf-problem/133946)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 2\
**Last updated:** [November 17, 2025, 8:35pm UTC](https://discourse.julialang.org/t/scanf-problem/133946 "2025-11-17T20:35:23Z")

</div>

In trying to read a line and convert it to variables my @scanf statement is giving unexpected (wrong) results. I am wondering if another set of eyes can pick out what I am doing wrong. julia\> using Scanf julia\> record…

---

## [Stackoverflow when loading PythonPlot](https://discourse.julialang.org/t/stackoverflow-when-loading-pythonplot/133928)

<div class="topic-metadata">

**Author:** [@maltee1](https://discourse.julialang.org/u/maltee1)\
**Replies:** 3\
**Last updated:** [November 17, 2025, 5:02pm UTC](https://discourse.julialang.org/t/stackoverflow-when-loading-pythonplot/133928 "2025-11-17T17:02:53Z")

</div>

This seems to be a python problem, but I’ve often had problems with python that could be solved simply be deleting and re-installing the corresponding packages. So I’m thinking this might be related to how Julia uses pyt…

---

## [Save a DataFrame preserving a column of matrices](https://discourse.julialang.org/t/save-a-dataframe-preserving-a-column-of-matrices/133895)

<div class="topic-metadata">

**Author:** [@contradict](https://discourse.julialang.org/u/contradict)\
**Replies:** 4\
**Last updated:** [November 17, 2025, 4:59pm UTC](https://discourse.julialang.org/t/save-a-dataframe-preserving-a-column-of-matrices/133895 "2025-11-17T16:59:02Z")

</div>

I have a DataFrame with a column of 3x3 Float32 matrices. I would like to save this to a file and later read it back, preserving this column. I tried this round trip with several tools: CSV =\> converts to String JSONTab…

---

## [Keyword arguments not allowed on left-hand side of broadcast assignments?](https://discourse.julialang.org/t/keyword-arguments-not-allowed-on-left-hand-side-of-broadcast-assignments/133920)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 1\
**Last updated:** [November 17, 2025, 3:18am UTC](https://discourse.julialang.org/t/keyword-arguments-not-allowed-on-left-hand-side-of-broadcast-assignments/133920 "2025-11-17T03:18:44Z")

</div>

Broadcasting with assignment works with a function call on the left-hand side. However, function calls with keyword arguments do not work for some reason: julia\> f(v; a = 0) = copy(v) f (generic function with 1 method) …

---

## [@run macro?](https://discourse.julialang.org/t/run-macro/133861)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 9\
**Last updated:** [November 16, 2025, 5:42am UTC](https://discourse.julialang.org/t/run-macro/133861 "2025-11-16T05:42:31Z")

</div>

How could a run macro be defined that executes a script? It should just include the file. Would something like: @run myscript.jl be possible as replacement for include("myscript.jl") ? That would save 7 keystrokes …

---

## [Linear Algebra Manipulations with Cholesky Factors](https://discourse.julialang.org/t/linear-algebra-manipulations-with-cholesky-factors/133899)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 1\
**Last updated:** [November 15, 2025, 6:51pm UTC](https://discourse.julialang.org/t/linear-algebra-manipulations-with-cholesky-factors/133899 "2025-11-15T18:51:20Z")

</div>

I’m working on a problem where I need to do some Gaussian random variable sampling, which would naive be implemented as: nx = 10 e = ones(nx) A = spdiagm(-1 =\> -e\[1:end-1\], 0 =\> 2e, 1 =\> -e\[1:end-1\]) chol = cholesky(A, …

---

## [Avoiding kronecker in optimization](https://discourse.julialang.org/t/avoiding-kronecker-in-optimization/133879)

<div class="topic-metadata">

**Author:** [@fibrebundl](https://discourse.julialang.org/u/fibrebundl)\
**Replies:** 7\
**Last updated:** [November 15, 2025, 2:53pm UTC](https://discourse.julialang.org/t/avoiding-kronecker-in-optimization/133879 "2025-11-15T14:53:03Z")

</div>

I have a scalar valued function whose gradient and hessian I can compute. However, the hessian involves a kronecker product. I’ve been using the Optim.jl package for optimization. Is there an efficient way of passing the…

---

## [Execute Function for each Julia Thread](https://discourse.julialang.org/t/execute-function-for-each-julia-thread/133889)

<div class="topic-metadata">

**Author:** [@Chrysoberyl](https://discourse.julialang.org/u/Chrysoberyl)\
**Replies:** 6\
**Last updated:** [November 15, 2025, 7:02am UTC](https://discourse.julialang.org/t/execute-function-for-each-julia-thread/133889 "2025-11-15T07:02:36Z")

</div>

I have an external library which requires thread local resources to function. For every thread Julia creates, it must notify this library via an initialize\_thread\_local() function. Is there a way to run this code for eac…

---

## [Automatically enable GC during JIT compile](https://discourse.julialang.org/t/automatically-enable-gc-during-jit-compile/133894)

<div class="topic-metadata">

**Author:** [@csvance](https://discourse.julialang.org/u/csvance)\
**Replies:** 2\
**Last updated:** [November 15, 2025, 12:19am UTC](https://discourse.julialang.org/t/automatically-enable-gc-during-jit-compile/133894 "2025-11-15T00:19:39Z")

</div>

To get the best performance for my Julia RPC server in production, I turn off GC during the execution of each request and manually call the GC after returning the response. Each Julia RPC server process only handles one …

---

## [I don't understand reducing over empty iterators](https://discourse.julialang.org/t/i-dont-understand-reducing-over-empty-iterators/133870)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 5\
**Last updated:** [November 14, 2025, 7:24pm UTC](https://discourse.julialang.org/t/i-dont-understand-reducing-over-empty-iterators/133870 "2025-11-14T19:24:36Z")

</div>

Consider the following example where I get this error even though I provide init julia\> foo(x, y, a\_set) = x - sum(y\[i\] for i in a\_set, init = zero(eltype(y))) foo (generic function with 1 method) julia\> foo(3, ones(4)…

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

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