# Latest

**URL:** https://discourse.julialang.org/latest.md?page=743

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

**Page:** 744

---

## [Best practices](https://discourse.julialang.org/t/best-practices/85138)

<div class="topic-metadata">

**Author:** [@Dario-Rosa85](https://discourse.julialang.org/u/Dario-Rosa85)\
**Replies:** 24\
**Last updated:** [March 25, 2023, 9:31am UTC](https://discourse.julialang.org/t/best-practices/85138 "2023-03-25T09:31:28Z")

</div>

I am running a code which is diagonalizing very large matrices, hence I need to reach the best possible performance. when scanning a vector I was using the following syntax for i in 1:length(vec) which works fine. How…

---

## [How to delete several rows from a dataframe in one command](https://discourse.julialang.org/t/how-to-delete-several-rows-from-a-dataframe-in-one-command/96575)

<div class="topic-metadata">

**Author:** [@CvR](https://discourse.julialang.org/u/CvR)\
**Replies:** 2\
**Last updated:** [March 25, 2023, 8:50am UTC](https://discourse.julialang.org/t/how-to-delete-several-rows-from-a-dataframe-in-one-command/96575 "2023-03-25T08:50:05Z")

</div>

Hi, I would like to delete several rows from a dataframe in one command. For example: deleteat!(df, \[row1, row2, row3\]) Where row(n) is a variable and is given by the user. I can delete one row with readline(): if …

---

## [Best way to Synchronize Threads/Lock variables in a nontrivial computation](https://discourse.julialang.org/t/best-way-to-synchronize-threads-lock-variables-in-a-nontrivial-computation/96157)

<div class="topic-metadata">

**Author:** [@eduardosalaz](https://discourse.julialang.org/u/eduardosalaz)\
**Replies:** 4\
**Last updated:** [March 25, 2023, 7:44am UTC](https://discourse.julialang.org/t/best-way-to-synchronize-threads-lock-variables-in-a-nontrivial-computation/96157 "2023-03-25T07:44:10Z")

</div>

Hi everyone. I have several questions regarding Parallel/Concurrent Programming with Julia. I have an algorithm which in simple terms does the following: function main(iters) bestVal = 1e9 fields = generate\_fields…

---

## [On the arbitrariness of truth(iness)](https://discourse.julialang.org/t/on-the-arbitrariness-of-truth-iness/81381)

<div class="topic-metadata">

**Author:** [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Replies:** 49\
**Last updated:** [March 25, 2023, 7:04am UTC](https://discourse.julialang.org/t/on-the-arbitrariness-of-truth-iness/81381 "2023-03-25T07:04:13Z")

</div>

Occasionally someone will be annoyed that Julia requires an actual true or false value in conditionals, whereas many dynamic languages (including Lisps) allow arbitrary values in conditions and have rules about what coun…

---

## [All solutions of linear program](https://discourse.julialang.org/t/all-solutions-of-linear-program/96562)

<div class="topic-metadata">

**Author:** [@ahmad88](https://discourse.julialang.org/u/ahmad88)\
**Replies:** 6\
**Last updated:** [March 25, 2023, 4:54am UTC](https://discourse.julialang.org/t/all-solutions-of-linear-program/96562 "2023-03-25T04:54:53Z")

</div>

if I have the following model VC\_model2 = direct\_model(Gurobi.Optimizer()) @variable(VC\_model2, y\[i=initial:n\], binary=true) @variable(VC\_model2, x\[i=initial:n\], binary=true) ########################################…

---

## [Zygote vs. Forward Diff with Optim](https://discourse.julialang.org/t/zygote-vs-forward-diff-with-optim/96565)

<div class="topic-metadata">

**Author:** [@gnicolosi](https://discourse.julialang.org/u/gnicolosi)\
**Replies:** 4\
**Last updated:** [March 24, 2023, 11:39pm UTC](https://discourse.julialang.org/t/zygote-vs-forward-diff-with-optim/96565 "2023-03-24T23:39:13Z")

</div>

Hi all, I am solving an optimization problem using an Augmented Lagrangian (AL) of a constrained parameterized problem. I have about 400 parameters and the AL spits out a scalar which is to be minimized. I have already …

---

## [Passing vectors of data into MTK/MoL problem as parameter](https://discourse.julialang.org/t/passing-vectors-of-data-into-mtk-mol-problem-as-parameter/96578)

<div class="topic-metadata">

**Author:** [@johnb](https://discourse.julialang.org/u/johnb)\
**Replies:** 2\
**Last updated:** [March 24, 2023, 11:05pm UTC](https://discourse.julialang.org/t/passing-vectors-of-data-into-mtk-mol-problem-as-parameter/96578 "2023-03-24T23:05:26Z")

</div>

I have been able to use vectors of data that I’ve passed through DataInterpolations as inputs/boundary conditions to a ModelingToolkit/MethodOfLines problem, but I would like to use the data vectors as MTK parameters to …

---

## [Efficient division for two probilities](https://discourse.julialang.org/t/efficient-division-for-two-probilities/96579)

<div class="topic-metadata">

**Author:** [@X\_Chen](https://discourse.julialang.org/u/X_Chen)\
**Replies:** 3\
**Last updated:** [March 24, 2023, 11:04pm UTC](https://discourse.julialang.org/t/efficient-division-for-two-probilities/96579 "2023-03-24T23:04:32Z")

</div>

Hi everyone, I have a very large dataframe (1 million observations) that I need to do calculation for two probabilities (p1 and p2): log(p1/(1-p2)). And my code is: log.(p1)/ (-p2.+1) I think my code is so inefficien…

---

## [Julia multithreading is running slower than serial, can someone please explain why…?](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/96545)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 14\
**Last updated:** [March 24, 2023, 10:03pm UTC](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/96545 "2023-03-24T22:03:49Z")

</div>

I am trying to parallelize an algorithm which looks like this. I couldn’t express my code right in my previous post The following algorithm takes an element from an odd column and adds it to the adjacent even coloumn. u…

---

## [Add a constraint to a model iteratively](https://discourse.julialang.org/t/add-a-constraint-to-a-model-iteratively/96558)

<div class="topic-metadata">

**Author:** [@ahmad88](https://discourse.julialang.org/u/ahmad88)\
**Replies:** 2\
**Last updated:** [March 24, 2023, 9:28pm UTC](https://discourse.julialang.org/t/add-a-constraint-to-a-model-iteratively/96558 "2023-03-24T21:28:32Z")

</div>

I have a model as follows VC\_model2 = direct\_model(Gurobi.Optimizer()) @variable(VC\_model2, y\[i=initial:n\], binary=true) @variable(VC\_model2, x\[i=initial:n\], binary=true) ###############################################…

---

## [Parallel quicksort openmp](https://discourse.julialang.org/t/parallel-quicksort-openmp/88499)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 30\
**Last updated:** [March 24, 2023, 8:26pm UTC](https://discourse.julialang.org/t/parallel-quicksort-openmp/88499 "2023-03-24T20:26:47Z")

</div>

Hi, I was wondering how it is possible to parallelise a quicksort algorithm below (from rosetta code) in Julia? In c with openmp one would use #pragma omp task. Example : But what is the equivalent in Julia? Thank …

---

## [Build an URI with query parameters](https://discourse.julialang.org/t/build-an-uri-with-query-parameters/96556)

<div class="topic-metadata">

**Author:** [@oliviermilla](https://discourse.julialang.org/u/oliviermilla)\
**Replies:** 2\
**Last updated:** [March 24, 2023, 6:58pm UTC](https://discourse.julialang.org/t/build-an-uri-with-query-parameters/96556 "2023-03-24T18:58:54Z")

</div>

Using URIs 1.4.2 How to generate URI with query parameters? URI("http://www.example.com"; query=Dict("a" =\> "b")) ERROR: MethodError: no method matching URI(::String; query=Dict("a" =\> "b")) Closest candidates are: …

---

## [Inconsistent solutions from JuMP vs InfiniteOpt for discretized optimal control](https://discourse.julialang.org/t/inconsistent-solutions-from-jump-vs-infiniteopt-for-discretized-optimal-control/96539)

<div class="topic-metadata">

**Author:** [@mbanchio](https://discourse.julialang.org/u/mbanchio)\
**Replies:** 4\
**Last updated:** [March 24, 2023, 5:53pm UTC](https://discourse.julialang.org/t/inconsistent-solutions-from-jump-vs-infiniteopt-for-discretized-optimal-control/96539 "2023-03-24T17:53:48Z")

</div>

Hello everyone, I have been playing around with JuMP recently to understand the structure of an optimal control problem. For clarity, the problem is the following. I want to find the function x(c,\\theta) such that \\fora…

---

## [Behavior of threads](https://discourse.julialang.org/t/behavior-of-threads/95769)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 33\
**Last updated:** [March 24, 2023, 5:34pm UTC](https://discourse.julialang.org/t/behavior-of-threads/95769 "2023-03-24T17:34:29Z")

</div>

The manual states: The @threads macro executes the loop body in an unspecified order and potentially concurrently. It does not specify the exact assignments of the tasks and the worker threads. The assignments can be d…

---

## [Difference between calling Iterators.rest on an array vs a range](https://discourse.julialang.org/t/difference-between-calling-iterators-rest-on-an-array-vs-a-range/96533)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 3\
**Last updated:** [March 24, 2023, 5:33pm UTC](https://discourse.julialang.org/t/difference-between-calling-iterators-rest-on-an-array-vs-a-range/96533 "2023-03-24T17:33:03Z")

</div>

I’m just curious why Iterators.rest yields different results depending on whether a range or an array is used. eg df1 = DataFrame( :x=\> 1:5) To start a loop on the second iteration of a range I would use collect(I…

---

## [Data property editor not working in GenieBuilder](https://discourse.julialang.org/t/data-property-editor-not-working-in-geniebuilder/96551)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 0\
**Last updated:** [March 24, 2023, 10:52am UTC](https://discourse.julialang.org/t/data-property-editor-not-working-in-geniebuilder/96551 "2023-03-24T10:52:32Z")

</div>

Hi all, I am going through a tutorial for Genie (which looks really nice by the way), but unfortunately some features are not working. I am trying to edit the min and max fields for the slider, but the value disappears …

---

## [VARX Model Estimation and Analysis](https://discourse.julialang.org/t/varx-model-estimation-and-analysis/96503)

<div class="topic-metadata">

**Author:** [@DionysisPap](https://discourse.julialang.org/u/DionysisPap)\
**Replies:** 8\
**Last updated:** [March 24, 2023, 4:51pm UTC](https://discourse.julialang.org/t/varx-model-estimation-and-analysis/96503 "2023-03-24T16:51:38Z")

</div>

As a beginner, i would like to ask if Julia provides any package (or function) for black box polynomial model estimation (preferably VARX model) and anaylis.

---

## [Custom image loader in Julia using MLUtils.jl](https://discourse.julialang.org/t/custom-image-loader-in-julia-using-mlutils-jl/96318)

<div class="topic-metadata">

**Author:** [@ATR](https://discourse.julialang.org/u/ATR)\
**Replies:** 7\
**Last updated:** [March 24, 2023, 4:25pm UTC](https://discourse.julialang.org/t/custom-image-loader-in-julia-using-mlutils-jl/96318 "2023-03-24T16:25:34Z")

</div>

I am new to Julia and feel a little bit confused about how to implement custom image loader, first I have generated 10 sample images and saved it in the temp folder, then I have defined “ImageFolder” but really got stuck…

---

## [Trouble with PyPlot](https://discourse.julialang.org/t/trouble-with-pyplot/96570)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 0\
**Last updated:** [March 24, 2023, 4:17pm UTC](https://discourse.julialang.org/t/trouble-with-pyplot/96570 "2023-03-24T16:17:43Z")

</div>

Anyone know what this means and how to fix it? This happened after I did an pkg\> update pkg\> build IJulia julia \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) …

---

## [Domain error with QuadGK to derive Caputo derivative](https://discourse.julialang.org/t/domain-error-with-quadgk-to-derive-caputo-derivative/96550)

<div class="topic-metadata">

**Author:** [@khaledharizb](https://discourse.julialang.org/u/khaledharizb)\
**Replies:** 2\
**Last updated:** [March 24, 2023, 3:57pm UTC](https://discourse.julialang.org/t/domain-error-with-quadgk-to-derive-caputo-derivative/96550 "2023-03-24T15:57:06Z")

</div>

Hi everyone! I’m trying to evaluate caputo derivative using Quadgk. It works unless when t=3 it gives me Domain error. With Mathematica I got the value -3.11522 using QuadGK, ForwardDiff, SpecialFunctions f(t)=t^2\*sin(t…

---

## [Producing Fold Bifurcation Diagram using BirfurcationKit](https://discourse.julialang.org/t/producing-fold-bifurcation-diagram-using-birfurcationkit/96543)

<div class="topic-metadata">

**Author:** [@Tristan](https://discourse.julialang.org/u/Tristan)\
**Replies:** 4\
**Last updated:** [March 24, 2023, 3:16pm UTC](https://discourse.julialang.org/t/producing-fold-bifurcation-diagram-using-birfurcationkit/96543 "2023-03-24T15:16:33Z")

</div>

I am trying to construct a bifurcation diagram in Julia using Bifurcation.Kit package. I cannot get the graph I am expect to produce. For some context, I am modeling a system of ODEs (non linear, 6 equations, and 6 unkno…

---

## [Translating tensorflow to Flux and SimpleChains and not getting the same results](https://discourse.julialang.org/t/translating-tensorflow-to-flux-and-simplechains-and-not-getting-the-same-results/96134)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 6\
**Last updated:** [March 24, 2023, 3:08pm UTC](https://discourse.julialang.org/t/translating-tensorflow-to-flux-and-simplechains-and-not-getting-the-same-results/96134 "2023-03-24T15:08:56Z")

</div>

For the past few days, I started working on an ML project. I looked at Flux.jl and SimpleChains.jl for doing pure Julia Deep Learning and TensorFlow, but I could not make them agree! The data: let say the model tries t…

---

## [Why making tuples from excels columns take so much times?](https://discourse.julialang.org/t/why-making-tuples-from-excels-columns-take-so-much-times/96560)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 5\
**Last updated:** [March 24, 2023, 2:42pm UTC](https://discourse.julialang.org/t/why-making-tuples-from-excels-columns-take-so-much-times/96560 "2023-03-24T14:42:09Z")

</div>

I have an excel sheet that has four colums of length 10000, and I’d like to create list of tuples from two colums. So, I used list comprehension first, and after 10 minutes is was still running. So, I did this: twos = V…

---

## [Is it possible to implement own \`.\<tab\>\` autocomplete for \`getindex\` in REPL (without AbstractDict)](https://discourse.julialang.org/t/is-it-possible-to-implement-own-tab-autocomplete-for-getindex-in-repl-without-abstractdict/96552)

<div class="topic-metadata">

**Author:** [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Replies:** 3\
**Last updated:** [March 24, 2023, 11:59am UTC](https://discourse.julialang.org/t/is-it-possible-to-implement-own-tab-autocomplete-for-getindex-in-repl-without-abstractdict/96552 "2023-03-24T11:59:40Z")

</div>

I have some datatype, for which I would like to have autocomplete for getindex/setindex!, e.g. myData\[.\<tab\> should give me all the keys(myData). So far, I get that I can subtype AbstractDict{Symbol,Any} to archive that…

---

## [Attractors.basins\_fractions throws "ArgumentError: range must be non-empty"](https://discourse.julialang.org/t/attractors-basins-fractions-throws-argumenterror-range-must-be-non-empty/96531)

<div class="topic-metadata">

**Author:** [@cjoshliu](https://discourse.julialang.org/u/cjoshliu)\
**Replies:** 3\
**Last updated:** [March 24, 2023, 10:06am UTC](https://discourse.julialang.org/t/attractors-basins-fractions-throws-argumenterror-range-must-be-non-empty/96531 "2023-03-24T10:06:02Z")

</div>

Hi, I’m trying to find basin fractions of an s-species (s-dimensional) generalized Lotka-Volterra model using DynamicalSystems. My model is d\_t\\vec{u}=\\vec{\\lambda}+\\vec{r}\\cdot\\vec{u}\\cdot (1-\\hat{\\alpha}\\vec{u}) wher…

---

## [Interaction of GeoJSON with GeoInterface methods](https://discourse.julialang.org/t/interaction-of-geojson-with-geointerface-methods/96535)

<div class="topic-metadata">

**Author:** [@Barget](https://discourse.julialang.org/u/Barget)\
**Replies:** 6\
**Last updated:** [March 24, 2023, 9:25am UTC](https://discourse.julialang.org/t/interaction-of-geojson-with-geointerface-methods/96535 "2023-03-24T09:25:35Z")

</div>

Hi, I’d like to read a .geojson file and perform some geometrical operations on the geometries (union, contains, etc.). Using LibGEOS or ArchGDAL works fine, but i’ve got some troubles with GeoJSON (maybe I’m missing s…

---

## [Macro to choose macros](https://discourse.julialang.org/t/macro-to-choose-macros/96507)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 6\
**Last updated:** [March 24, 2023, 8:35am UTC](https://discourse.julialang.org/t/macro-to-choose-macros/96507 "2023-03-24T08:35:19Z")

</div>

It seems I still don’t understand how macros really work in Julia. (sigh) I want to define a macro @always\_fast which will insert @simd or Threads.@threads depending on the value of Threads.nthreads() for cases like: @…

---

## [Accessing agent- and model-data in combination](https://discourse.julialang.org/t/accessing-agent-and-model-data-in-combination/96517)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 2\
**Last updated:** [March 24, 2023, 7:46am UTC](https://discourse.julialang.org/t/accessing-agent-and-model-data-in-combination/96517 "2023-03-24T07:46:47Z")

</div>

Hi. I want to use abm\_exploration to display data that requires access to both agents and model, something like this: function demo() model = initialise\_model() params = Dict( :reaction\_norm =\> 0:0.01:1, ) plotkwa…

---

## [Is Julia well-suited for string manipulation?](https://discourse.julialang.org/t/is-julia-well-suited-for-string-manipulation/92943)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 24\
**Last updated:** [March 24, 2023, 4:26am UTC](https://discourse.julialang.org/t/is-julia-well-suited-for-string-manipulation/92943 "2023-03-24T04:26:51Z")

</div>

Why do I sometimes read that Julia is not particularly well suited for string manipulation? I read about Perl or Python being good at that but I’ve never seen a technical explanation what puts Julia at a disadvantage per…

---

## [Adding a play button to a PlotlyJS plot](https://discourse.julialang.org/t/adding-a-play-button-to-a-plotlyjs-plot/95383)

<div class="topic-metadata">

**Author:** [@phiG](https://discourse.julialang.org/u/phiG)\
**Replies:** 10\
**Last updated:** [March 24, 2023, 2:05am UTC](https://discourse.julialang.org/t/adding-a-play-button-to-a-plotlyjs-plot/95383 "2023-03-24T02:05:22Z")

</div>

Hi everyone, since I got a perfect answer last time on how to add sliders to a Plotly Plot in the first place, this time I would be delighted if someone could help me edit the code below such that there is a Play Button…

[Previous page](https://discourse.julialang.org/latest.md?page=742)

[Next page](https://discourse.julialang.org/latest.md?page=744)
