# Latest

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

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

**Page:** 1163

---

## [CUDA on Julia 1.7 giving wrong results](https://discourse.julialang.org/t/cuda-on-julia-1-7-giving-wrong-results/73997)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 5\
**Last updated:** [January 3, 2022, 9:31pm UTC](https://discourse.julialang.org/t/cuda-on-julia-1-7-giving-wrong-results/73997 "2022-01-03T21:31:47Z")

</div>

Hi all, I have a fairly complex code that has worked well with julia 1.5 - 1.6. I have tried to run this with te latest julia 1.7, and the code runs, but produces wrong results. This is the list of packages used, in cas…

---

## [How to transpose a DataFrame?](https://discourse.julialang.org/t/how-to-transpose-a-dataframe/74000)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 3\
**Last updated:** [January 3, 2022, 9:06pm UTC](https://discourse.julialang.org/t/how-to-transpose-a-dataframe/74000 "2022-01-03T21:06:14Z")

</div>

For example, if I have a DataFrame like the below. How do I transpose it? df = 12×5 DataFrame Row │ Variable Col1 Col2 Col3 Col4 │ String Float64 Float64 Float64 Float64…

---

## [Filter date from a feather DataFrame JULIA](https://discourse.julialang.org/t/filter-date-from-a-feather-dataframe-julia/73993)

<div class="topic-metadata">

**Author:** [@SamanthaCassab](https://discourse.julialang.org/u/SamanthaCassab)\
**Replies:** 4\
**Last updated:** [January 3, 2022, 9:01pm UTC](https://discourse.julialang.org/t/filter-date-from-a-feather-dataframe-julia/73993 "2022-01-03T21:01:54Z")

</div>

Hi, I want to filter my DataFrame by Date, but the column wich has the date has the following type: Typeof(DateTime("2021-12-17T06:00:00")) Feather.Arrow.Timestamp{Microsecond} The column look like: DateTime("2020-12…

---

## [Syntax for indicator constraints](https://discourse.julialang.org/t/syntax-for-indicator-constraints/73716)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 4\
**Last updated:** [January 3, 2022, 7:41pm UTC](https://discourse.julialang.org/t/syntax-for-indicator-constraints/73716 "2022-01-03T19:41:37Z")

</div>

I have a model with two constraints. The first constraint is a big M constraint, which I am trying to reformulate as an indictor constraint. I have tried to follow the syntax given in the documentation, but I don’t get a…

---

## [JuMP: constraint to use a value only \`n\` times](https://discourse.julialang.org/t/jump-constraint-to-use-a-value-only-n-times/73930)

<div class="topic-metadata">

**Author:** [@Sushant-Padha](https://discourse.julialang.org/u/Sushant-Padha)\
**Replies:** 5\
**Last updated:** [January 3, 2022, 7:38pm UTC](https://discourse.julialang.org/t/jump-constraint-to-use-a-value-only-n-times/73930 "2022-01-03T19:38:41Z")

</div>

I am trying to solve a problem using ConstraintSolver.jl which uses JuMP. I want to define a constraint for a group of variables, such that certain values are only chosen certain times. For eg: if the variables are 1 \<=…

---

## [I just joined the course and find that I can get no sound at all on my Raspberry.4.00 on your course](https://discourse.julialang.org/t/i-just-joined-the-course-and-find-that-i-can-get-no-sound-at-all-on-my-raspberry-4-00-on-your-course/73412)

<div class="topic-metadata">

**Author:** [@anon70284489](https://discourse.julialang.org/u/anon70284489)\
**Replies:** 12\
**Last updated:** [January 3, 2022, 7:04pm UTC](https://discourse.julialang.org/t/i-just-joined-the-course-and-find-that-i-can-get-no-sound-at-all-on-my-raspberry-4-00-on-your-course/73412 "2022-01-03T19:04:46Z")

</div>

I have no other system to use for the course and can see no way that I could even consider taking the course without any sound. I have in fact already upgraded the pi from 32 bit to 64 bit specifically in order to take y…

---

## [Ask \`TerminateSteadyState\` Callback to only start after a certain amount of time](https://discourse.julialang.org/t/ask-terminatesteadystate-callback-to-only-start-after-a-certain-amount-of-time/73779)

<div class="topic-metadata">

**Author:** [@colebrookson](https://discourse.julialang.org/u/colebrookson)\
**Replies:** 2\
**Last updated:** [January 3, 2022, 5:54pm UTC](https://discourse.julialang.org/t/ask-terminatesteadystate-callback-to-only-start-after-a-certain-amount-of-time/73779 "2022-01-03T17:54:30Z")

</div>

I’m using the DiffEqCallback.jl library’s TerminateSteadyState callback to help me terminate a long simulation if it reaches some steady state, but I’m wondering if there’s a way to only have the function start looking f…

---

## [How to pass arguments to Cmd?](https://discourse.julialang.org/t/how-to-pass-arguments-to-cmd/73959)

<div class="topic-metadata">

**Author:** [@melonedo](https://discourse.julialang.org/u/melonedo)\
**Replies:** 5\
**Last updated:** [January 3, 2022, 5:22pm UTC](https://discourse.julialang.org/t/how-to-pass-arguments-to-cmd/73959 "2022-01-03T17:22:47Z")

</div>

For example I might call \`echo\` with argument "hello", how can I do it? Assume cmd = \`eho\` , I found that push!(cmd.exec, "hello" does the trick, but exec is not documented, is this recommended? Also, run from Base has …

---

## [Mixed multi-cell hide details in Pluto](https://discourse.julialang.org/t/mixed-multi-cell-hide-details-in-pluto/73824)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 6\
**Last updated:** [January 3, 2022, 4:31pm UTC](https://discourse.julialang.org/t/mixed-multi-cell-hide-details-in-pluto/73824 "2022-01-03T16:31:29Z")

</div>

I would like to hide multiple cells of details in Pluto. The example notebooks in Pluto includes the following function to hide/expand details for a single cell: details(inputs...; summary="Show more") = @htl(""" \<deta…

---

## [DataFrames: how to convert many arrays into a data frame?](https://discourse.julialang.org/t/dataframes-how-to-convert-many-arrays-into-a-data-frame/73966)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 3\
**Last updated:** [January 3, 2022, 3:29pm UTC](https://discourse.julialang.org/t/dataframes-how-to-convert-many-arrays-into-a-data-frame/73966 "2022-01-03T15:29:25Z")

</div>

Suppose I ran different loops in a notebook. In each one, I obtain e,g., a 1×120 Matrix{Float64} array. I want to collect some of them in a data frame. I know how to do it (please, see MWE below). However, I find my clum…

---

## [Macro works in REPL but not in script](https://discourse.julialang.org/t/macro-works-in-repl-but-not-in-script/69685)

<div class="topic-metadata">

**Author:** [@emanuellima](https://discourse.julialang.org/u/emanuellima)\
**Replies:** 7\
**Last updated:** [January 3, 2022, 1:09pm UTC](https://discourse.julialang.org/t/macro-works-in-repl-but-not-in-script/69685 "2022-01-03T13:09:37Z")

</div>

So, I have a macro that works fine in the REPL, but doesn’t work when called on a script and I don’t know why. The macro simply creates a struct based on information stored in a NamedTuple. There is a regular function th…

---

## [Is there any way to produce a Type by cat strings together?](https://discourse.julialang.org/t/is-there-any-way-to-produce-a-type-by-cat-strings-together/73961)

<div class="topic-metadata">

**Author:** [@timacro](https://discourse.julialang.org/u/timacro)\
**Replies:** 2\
**Last updated:** [January 3, 2022, 12:44pm UTC](https://discourse.julialang.org/t/is-there-any-way-to-produce-a-type-by-cat-strings-together/73961 "2022-01-03T12:44:36Z")

</div>

To define a set of Regxx types，It would be OK with these pieces of code: for (bits,t) in \[(8,UInt8),(16,UInt16),(32,UInt32)\] rname = Symbol("Reg",bits) @eval struct $rname addr::UInt32 data::$t …

---

## [Lazy.jl list overhead](https://discourse.julialang.org/t/lazy-jl-list-overhead/73958)

<div class="topic-metadata">

**Author:** [@jekyllstein](https://discourse.julialang.org/u/jekyllstein)\
**Replies:** 0\
**Last updated:** [January 3, 2022, 11:39am UTC](https://discourse.julialang.org/t/lazy-jl-list-overhead/73958 "2022-01-03T11:39:19Z")

</div>

I was experimenting with Lazy.jl and was wondering why there was significant overhead for accessing the first item of a list with a sufficiently complicated comprehension. function testlist(n) l = @lazy \[x^2 for x …

---

## [Difference between subsetting methods](https://discourse.julialang.org/t/difference-between-subsetting-methods/73951)

<div class="topic-metadata">

**Author:** [@aachener](https://discourse.julialang.org/u/aachener)\
**Replies:** 2\
**Last updated:** [January 3, 2022, 9:09am UTC](https://discourse.julialang.org/t/difference-between-subsetting-methods/73951 "2022-01-03T09:09:52Z")

</div>

Hi, guys, I’ve got a basic question about subsetting of DFs. As shown below, what the difference between dd.y\[1:2\] and dd\[1:2, :y\]? My guess is that the former is in-place and the latter is copy of the selection. But th…

---

## [LSTM with batch vs with individual values](https://discourse.julialang.org/t/lstm-with-batch-vs-with-individual-values/73722)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 4\
**Last updated:** [January 3, 2022, 10:37am UTC](https://discourse.julialang.org/t/lstm-with-batch-vs-with-individual-values/73722 "2022-01-03T10:37:37Z")

</div>

Looks like there are two ways of calling models (running forecasting/regression/etc) in Flux: “batch mode” (model(data\_matrix)) and “vector comprehension mode” (\[model(elem)\[1\] for elem in data\_vector\]), where elem is on…

---

## [Automatic light/dark theme change in documentation](https://discourse.julialang.org/t/automatic-light-dark-theme-change-in-documentation/73864)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 4\
**Last updated:** [January 3, 2022, 9:24am UTC](https://discourse.julialang.org/t/automatic-light-dark-theme-change-in-documentation/73864 "2022-01-03T09:24:46Z")

</div>

I find that some packages (e.g., DifferentialEquations.jl) have documentations that change their themes automatically between light/dark depending on day/night, whereas other packages (e.g., HartreeFockBogoliubov.jl) don…

---

## [Check if current file is "main" when debugging](https://discourse.julialang.org/t/check-if-current-file-is-main-when-debugging/73893)

<div class="topic-metadata">

**Author:** [@Yue-Zhengyuan](https://discourse.julialang.org/u/Yue-Zhengyuan)\
**Replies:** 2\
**Last updated:** [January 3, 2022, 9:14am UTC](https://discourse.julialang.org/t/check-if-current-file-is-main-when-debugging/73893 "2022-01-03T09:14:56Z")

</div>

In Julia documentation, it is said that to determine that a file is run as the main script, one can check if abspath(PROGRAM\_FILE) == @\_\_FILE\_\_ is true. When directly running the file, this works fine. However, when debu…

---

## [Any equivalent of Google translate (like in gsheet) for DataFrames?](https://discourse.julialang.org/t/any-equivalent-of-google-translate-like-in-gsheet-for-dataframes/73904)

<div class="topic-metadata">

**Author:** [@o314](https://discourse.julialang.org/u/o314)\
**Replies:** 5\
**Last updated:** [January 3, 2022, 9:10am UTC](https://discourse.julialang.org/t/any-equivalent-of-google-translate-like-in-gsheet-for-dataframes/73904 "2022-01-03T09:10:50Z")

</div>

Hello there, I’m used to googletranslating cell in google sheet, a solution that works quite well. I wonder if there is any simple solution that can be used with DataFrames to translate some cell ? The fact is i need …

---

## [\[ANN\] MuseInference.jl (drop-in replacement for HMC / VI, try it on your problem!)](https://discourse.julialang.org/t/ann-museinference-jl-drop-in-replacement-for-hmc-vi-try-it-on-your-problem/73468)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 4\
**Last updated:** [January 3, 2022, 7:40am UTC](https://discourse.julialang.org/t/ann-museinference-jl-drop-in-replacement-for-hmc-vi-try-it-on-your-problem/73468 "2022-01-03T07:40:28Z")

</div>

Earlier this week we put out a paper describing a new method for hierarchical Bayesian inference we dubbed the Marginal Unbiased Score Expansion (MUSE), which can pretty drastically outperform HMC / VI for a wide class o…

---

## [Is it possible that numerical optimisation solve time decreases for some range of dimensions from low to moderate levels?](https://discourse.julialang.org/t/is-it-possible-that-numerical-optimisation-solve-time-decreases-for-some-range-of-dimensions-from-low-to-moderate-levels/73857)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 11\
**Last updated:** [January 3, 2022, 4:07am UTC](https://discourse.julialang.org/t/is-it-possible-that-numerical-optimisation-solve-time-decreases-for-some-range-of-dimensions-from-low-to-moderate-levels/73857 "2022-01-03T04:07:00Z")

</div>

Hi, I encountered a weird phenomenon of solve time calculation in numerical optimisation. Backgrounds There is a bunch of approximators, \\{ f\_j \\}\_{j \\in J}. For example, f\_1 is a feedforward (dense) neural network, an…

---

## [ModelingToolkit second derivative only gives first derivative](https://discourse.julialang.org/t/modelingtoolkit-second-derivative-only-gives-first-derivative/70703)

<div class="topic-metadata">

**Author:** [@ctessum](https://discourse.julialang.org/u/ctessum)\
**Replies:** 2\
**Last updated:** [January 3, 2022, 3:31am UTC](https://discourse.julialang.org/t/modelingtoolkit-second-derivative-only-gives-first-derivative/70703 "2022-01-03T03:31:47Z")

</div>

Hello, I’m running into an issue that has left me confused. Using ModelingToolkit v6.7.1, I (for example) want to simulate a falling object. So: @variables t \[unit = u"s"\] x(t) \[unit = u"m"\] v(t) \[unit = u"m/s"\] @param…

---

## [Opaque code - pascal's triangle](https://discourse.julialang.org/t/opaque-code-pascals-triangle/73949)

<div class="topic-metadata">

**Author:** [@jonoke](https://discourse.julialang.org/u/jonoke)\
**Replies:** 1\
**Last updated:** [January 3, 2022, 12:55am UTC](https://discourse.julialang.org/t/opaque-code-pascals-triangle/73949 "2022-01-03T00:55:19Z")

</div>

I saw this solution to pascal’s triangle on exercism and have no idea what the last line (push!(…)) is doing - could someone please explain - or translate the code into english? function triangle(n::Int) n\<0 && thro…

---

## [Problem with Documenter Clean Up](https://discourse.julialang.org/t/problem-with-documenter-clean-up/73946)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 0\
**Last updated:** [January 2, 2022, 11:21pm UTC](https://discourse.julialang.org/t/problem-with-documenter-clean-up/73946 "2022-01-02T23:21:11Z")

</div>

I am not able to use the Doc Preview Cleanup, as explained here. Using the very same workflow they have described, I obtain the following error message git config user.name "Documenter.jl" git config user.email "do…

---

## [Struct, push!, unexpected result](https://discourse.julialang.org/t/struct-push-unexpected-result/73901)

<div class="topic-metadata">

**Author:** [@das](https://discourse.julialang.org/u/das)\
**Replies:** 11\
**Last updated:** [January 2, 2022, 10:00pm UTC](https://discourse.julialang.org/t/struct-push-unexpected-result/73901 "2022-01-02T22:00:22Z")

</div>

I am trying to append a (musical) note of type Note to a sequence, which is a Vector of type Note. When i is 1, the result is: sequence: Note\[Note(0x00000002, 0x5d, 0x38, 0x0000000d, 0x40)\] which is correct. When i = 2…

---

## [Optimize many non linear functions](https://discourse.julialang.org/t/optimize-many-non-linear-functions/73761)

<div class="topic-metadata">

**Author:** [@jmmshn](https://discourse.julialang.org/u/jmmshn)\
**Replies:** 4\
**Last updated:** [January 2, 2022, 8:44pm UTC](https://discourse.julialang.org/t/optimize-many-non-linear-functions/73761 "2022-01-02T20:44:06Z")

</div>

I’m tying optimize the sum of series objective functions in funcs using the Ipot optimizer A minimal example shown below show result in an optimal objective value of 5. However it current returns objective\_value(model)…

---

## [(JuMP+NLopt) Only initial value returned without error warning](https://discourse.julialang.org/t/jump-nlopt-only-initial-value-returned-without-error-warning/73074)

<div class="topic-metadata">

**Author:** [@RunguangLi](https://discourse.julialang.org/u/RunguangLi)\
**Replies:** 7\
**Last updated:** [January 2, 2022, 8:40pm UTC](https://discourse.julialang.org/t/jump-nlopt-only-initial-value-returned-without-error-warning/73074 "2022-01-02T20:40:31Z")

</div>

For a nonlinear optimization problem with 9 parameters, calling Ipopt works well, while calling NLopt only returns the initial value without any error warning. Could someone tell me how to correct it? Using NLopt: usin…

---

## [Expected the file \`src/HijriConverter.jl\` to exist for package \`HijriConverter\` at \`.../HijriConverter.jl\`](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935)

<div class="topic-metadata">

**Author:** [@jafar.isbarov](https://discourse.julialang.org/u/jafar.isbarov)\
**Replies:** 6\
**Last updated:** [January 2, 2022, 7:29pm UTC](https://discourse.julialang.org/t/expected-the-file-src-hijriconverter-jl-to-exist-for-package-hijriconverter-at-hijriconverter-jl/73935 "2022-01-02T19:29:44Z")

</div>

I am trying to add dependencies to a package that I am developing, but I get the following error: (HijriConverter) pkg\> add Parameters Updating registry at \`~/.julia/registries/General.toml\` Resolving package ver…

---

## [Long Math Operation result is 0, In Python isn't](https://discourse.julialang.org/t/long-math-operation-result-is-0-in-python-isnt/73720)

<div class="topic-metadata">

**Author:** [@Jogrefer](https://discourse.julialang.org/u/Jogrefer)\
**Replies:** 7\
**Last updated:** [January 2, 2022, 7:20pm UTC](https://discourse.julialang.org/t/long-math-operation-result-is-0-in-python-isnt/73720 "2022-01-02T19:20:15Z")

</div>

Hi everyone :slight\_smile: Well, I’m new in this in general and just testing the REPL with random numbers. Why this is happening and what I’ve to learn previous to declare operations like this one? In Julia (1.7.0): n…

---

## [How to deal with CompatHelper PRs on 1.7](https://discourse.julialang.org/t/how-to-deal-with-compathelper-prs-on-1-7/73936)

<div class="topic-metadata">

**Author:** [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Replies:** 0\
**Last updated:** [January 2, 2022, 5:57pm UTC](https://discourse.julialang.org/t/how-to-deal-with-compathelper-prs-on-1-7/73936 "2022-01-02T17:57:55Z")

</div>

Hello, since 1.7 CompatHelper PRs in GH actions use the force\_latest\_compatible\_version flag. In theory, that’s great because you won’t bump versions which aren’t tested (CH.jl#160). In reality it is not that easy: one…

---

## [Unexpected memory allocation behavior](https://discourse.julialang.org/t/unexpected-memory-allocation-behavior/73922)

<div class="topic-metadata">

**Author:** [@Siddharth\_Bhatia](https://discourse.julialang.org/u/Siddharth_Bhatia)\
**Replies:** 6\
**Last updated:** [January 2, 2022, 5:36pm UTC](https://discourse.julialang.org/t/unexpected-memory-allocation-behavior/73922 "2022-01-02T17:36:46Z")

</div>

Hello. I am using julia 1.7.1. I am facing trouble trying to understand an unexpected memory allocation in the below simplified and self-contained program: struct VerticalLine{I} i\_min::I i\_max::I j::I end …

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

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