# General Usage

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

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

**Page:** 501

---

## [What's julia's solution to tapply or accumarray?](https://discourse.julialang.org/t/whats-julias-solution-to-tapply-or-accumarray/70055)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 15\
**Last updated:** [January 3, 2022, 10:36pm UTC](https://discourse.julialang.org/t/whats-julias-solution-to-tapply-or-accumarray/70055 "2022-01-03T22:36:41Z")

</div>

I have one-column Index as the below: A = \[1, 2, 2, 3, 3, 3\]; I have a matrix B as the below: B = \[1 2 3; 2 3 4; 3 4 5; 4 5 6; 5 6 7; 6 7 8\]; I would want to calculate the average of the duplicate rows based on Index…

---

## [Concise unpacking syntax](https://discourse.julialang.org/t/concise-unpacking-syntax/74004)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 3\
**Last updated:** [January 3, 2022, 10:16pm UTC](https://discourse.julialang.org/t/concise-unpacking-syntax/74004 "2022-01-03T22:16:00Z")

</div>

I have a namedtuple data = (;a=1,b=2,c=3) and a function f that takes kwargs ;a,b. I want to call f with f(;a,b) f(;a,b) = a+b data = (;a=1,b=2,c=3) (;a,b) = data f(;a,b) But there I have to specify a and b twice: once…

---

## [Alternative to codecov](https://discourse.julialang.org/t/alternative-to-codecov/73856)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [January 3, 2022, 10:15pm UTC](https://discourse.julialang.org/t/alternative-to-codecov/73856 "2022-01-03T22:15:03Z")

</div>

Since a few days code coverage is not working for me. I get the error: Error uhttps://codecov.ioploading to : Error: There was an error fetching the storage URL during POST: 429 - Too Many Requests Is this a server pro…

---

## [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…

---

## [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…

---

## [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…

---

## [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 …

---

## [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…

---

## [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 …

---

## [Is there any way to run an external command with \* in it?](https://discourse.julialang.org/t/is-there-any-way-to-run-an-external-command-with-in-it/73926)

<div class="topic-metadata">

**Author:** [@JackStrauss](https://discourse.julialang.org/u/JackStrauss)\
**Replies:** 4\
**Last updated:** [January 2, 2022, 1:39pm UTC](https://discourse.julialang.org/t/is-there-any-way-to-run-an-external-command-with-in-it/73926 "2022-01-02T13:39:12Z")

</div>

Hello I am trying to run an external command "rsync \* a: " with run() and the \* makes it impossible. there is an old unresolved question on this. How to quote special characters in run() function I am now making a deto…

---

## [VSCode / Julia 1.7.1 / Windows 7 issue](https://discourse.julialang.org/t/vscode-julia-1-7-1-windows-7-issue/73920)

<div class="topic-metadata">

**Author:** [@ivborissov](https://discourse.julialang.org/u/ivborissov)\
**Replies:** 0\
**Last updated:** [January 2, 2022, 10:19am UTC](https://discourse.julialang.org/t/vscode-julia-1-7-1-windows-7-issue/73920 "2022-01-02T10:19:50Z")

</div>

Hi, The problem seems to be trivial, but I haven’t found any solutions yet. VSCode Extension reports Could not start the Julia language server. Make sure the configuration setting julia.executablePath points to the Juli…

---

## [Squeezing performance out of ODE solves with interpolations](https://discourse.julialang.org/t/squeezing-performance-out-of-ode-solves-with-interpolations/73519)

<div class="topic-metadata">

**Author:** [@qtoloza](https://discourse.julialang.org/u/qtoloza)\
**Replies:** 6\
**Last updated:** [January 2, 2022, 9:31am UTC](https://discourse.julialang.org/t/squeezing-performance-out-of-ode-solves-with-interpolations/73519 "2022-01-02T09:31:10Z")

</div>

Hi all! I’m trying to squeeze performance gains out of two sets of ODEs that I need to solve many times at relatively low tolerances (~1e-10). I’ve benefited enormously from reading other posts and the performance tips …

---

## [Filling an array with a generator that returns tuples](https://discourse.julialang.org/t/filling-an-array-with-a-generator-that-returns-tuples/62737)

<div class="topic-metadata">

**Author:** [@fedario](https://discourse.julialang.org/u/fedario)\
**Replies:** 4\
**Last updated:** [January 2, 2022, 8:03am UTC](https://discourse.julialang.org/t/filling-an-array-with-a-generator-that-returns-tuples/62737 "2022-01-02T08:03:01Z")

</div>

I’m trying to create a function that takes a number of iterables and fills an array columnwise with each combination of those. The following function has the correct output, but the number of allocations is unexpected. u…

---

## [HTTP API Assistance](https://discourse.julialang.org/t/http-api-assistance/43916)

<div class="topic-metadata">

**Author:** [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Replies:** 3\
**Last updated:** [January 1, 2022, 10:08pm UTC](https://discourse.julialang.org/t/http-api-assistance/43916 "2022-01-01T22:08:18Z")

</div>

Hello, I am trying to translate this Python3 script into Julia (https://github.com/Brightspace/bds-headless-client-example/blob/master/main.py) to gain more familiarity with Julia and building an application that relies…

---

## [How to suppress equation numbers in Franklin?](https://discourse.julialang.org/t/how-to-suppress-equation-numbers-in-franklin/73835)

<div class="topic-metadata">

**Author:** [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Replies:** 5\
**Last updated:** [January 1, 2022, 9:49pm UTC](https://discourse.julialang.org/t/how-to-suppress-equation-numbers-in-franklin/73835 "2022-01-01T21:49:38Z")

</div>

It seems that Franklin.jl doesn’t currently support the “\*” form of math environments, which are used to suppress equation numbers (see this issue). For example, the fragment \\begin{equation\*} \\alpha \\end{equation\*} t…

---

## [Access to DimensionalData time axis](https://discourse.julialang.org/t/access-to-dimensionaldata-time-axis/73877)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 4\
**Last updated:** [January 1, 2022, 1:24pm UTC](https://discourse.julialang.org/t/access-to-dimensionaldata-time-axis/73877 "2022-01-01T13:24:44Z")

</div>

If I have a DimensionalData variable like using DimensionalData a = DimArray(rand(12), Ti(DateTime(2001):Month(1):DateTime(2001,12))) a.data gives data but how to access the time axis (e.g. for plotting in Makie)?

---

## [MacroTools splitarg interface change RFC](https://discourse.julialang.org/t/macrotools-splitarg-interface-change-rfc/73885)

<div class="topic-metadata">

**Author:** [@willow](https://discourse.julialang.org/u/willow)\
**Replies:** 2\
**Last updated:** [January 1, 2022, 7:21am UTC](https://discourse.julialang.org/t/macrotools-splitarg-interface-change-rfc/73885 "2022-01-01T07:21:57Z")

</div>

MacroTools splitarg and combinearg no longer work with functions that have keyword argument splats in Julia 1.7. To fix this issue, we need to avoid trying to typeassert the keyword argument splat. MacroTools used to ret…

---

## [Rationale for Pipe Order of Operations?](https://discourse.julialang.org/t/rationale-for-pipe-order-of-operations/73694)

<div class="topic-metadata">

**Author:** [@kapple](https://discourse.julialang.org/u/kapple)\
**Replies:** 4\
**Last updated:** [January 1, 2022, 3:33am UTC](https://discourse.julialang.org/t/rationale-for-pipe-order-of-operations/73694 "2022-01-01T03:33:31Z")

</div>

I feel like both blocks should result in the same result of 7. Is there a reason why the pipe isn’t the last thing processed?

---

## [While loop and parallel computing](https://discourse.julialang.org/t/while-loop-and-parallel-computing/73862)

<div class="topic-metadata">

**Author:** [@Igor\_Douven](https://discourse.julialang.org/u/Igor_Douven)\
**Replies:** 8\
**Last updated:** [December 31, 2021, 10:36pm UTC](https://discourse.julialang.org/t/while-loop-and-parallel-computing/73862 "2021-12-31T22:36:34Z")

</div>

Dear all, Suppose I have a container, say res = \[\], that I want to be filled by the output of a function, say f() = rand() \> .5 ? 1 : nothing. Suppose I’m done once res has a certain length. Given that the actual functi…

---

## [Multithreading and Monte Carlo in 1.7](https://discourse.julialang.org/t/multithreading-and-monte-carlo-in-1-7/73721)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 12\
**Last updated:** [December 31, 2021, 10:11pm UTC](https://discourse.julialang.org/t/multithreading-and-monte-carlo-in-1-7/73721 "2021-12-31T22:11:34Z")

</div>

I have an elementary Monte Carlo computation that I want to do that amounts to: results = zeros(n\_trials); for i in 1:n\_trials results\[i\] = # relatively expensive Monte Carlo function end I’m finding that the stati…

---

## [Can a type be declared as a subtype of my abstract type and Tuple?](https://discourse.julialang.org/t/can-a-type-be-declared-as-a-subtype-of-my-abstract-type-and-tuple/73867)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 1\
**Last updated:** [December 31, 2021, 7:19pm UTC](https://discourse.julialang.org/t/can-a-type-be-declared-as-a-subtype-of-my-abstract-type-and-tuple/73867 "2021-12-31T19:19:06Z")

</div>

Say I have abstract type Custom end, how can I declare a tuple-like type that is both \<:Tuple and \<:Custom so that methods of Tuple works on Custom. Note that I would like vararg-tuple if possible. Thanks!

---

## [ODBC Firebird: Dynamic SQL Error](https://discourse.julialang.org/t/odbc-firebird-dynamic-sql-error/73869)

<div class="topic-metadata">

**Author:** [@Fabio\_Sodre](https://discourse.julialang.org/u/Fabio_Sodre)\
**Replies:** 0\
**Last updated:** [December 31, 2021, 4:49pm UTC](https://discourse.julialang.org/t/odbc-firebird-dynamic-sql-error/73869 "2021-12-31T16:49:09Z")

</div>

ODBC.jl v1.0.4 I try to do a simple query to a Firebird database but an error is coming: ERROR: HY000: \[ODBC Firebird Driver\]\[Firebird\]Dynamic SQL Error SQL error code = -104 Unexpected end of command - line 1, colum…

---

## [Pluto: printing multiple statements in a for loop](https://discourse.julialang.org/t/pluto-printing-multiple-statements-in-a-for-loop/73858)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 2\
**Last updated:** [December 31, 2021, 4:15pm UTC](https://discourse.julialang.org/t/pluto-printing-multiple-statements-in-a-for-loop/73858 "2021-12-31T16:15:08Z")

</div>

Hi, I have a simple for loop that involves printing multiple statements. This material is for teaching, so I want to keep it intuitive and straightforward. The code below works in VSCode and Jupyter, but I do not know h…

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

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