# General Usage

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

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

**Page:** 384

---

## [Vector Multiplication on Submatrices](https://discourse.julialang.org/t/vector-multiplication-on-submatrices/88686)

<div class="topic-metadata">

**Author:** [@willsharpless](https://discourse.julialang.org/u/willsharpless)\
**Replies:** 9\
**Last updated:** [October 14, 2022, 10:29pm UTC](https://discourse.julialang.org/t/vector-multiplication-on-submatrices/88686 "2022-10-14T22:29:19Z")

</div>

If I have a matrix which is a (horizontal) collection of matrices, A := \\begin{bmatrix} A\_0 & A\_1 & A\_2 & \\dots & A\_t \\end{bmatrix} , \\quad A\_i \\in \\mathbb{R}^{n \\times n}, A \\in \\mathbb{R}^{n \\times tn} and I want …

---

## [Why does fill(:a)\[1\] work?](https://discourse.julialang.org/t/why-does-fill-a-1-work/88752)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [October 14, 2022, 8:10pm UTC](https://discourse.julialang.org/t/why-does-fill-a-1-work/88752 "2022-10-14T20:10:57Z")

</div>

Why does fill(:a)\[1\] work? It is a zero-dimensional array, so I expect it to index with fill(:a)\[\] but apparently \[1\] also works.

---

## [How to access/ change a parameter inside loop?](https://discourse.julialang.org/t/how-to-access-change-a-parameter-inside-loop/88747)

<div class="topic-metadata">

**Author:** [@Mike\_comen](https://discourse.julialang.org/u/Mike_comen)\
**Replies:** 5\
**Last updated:** [October 14, 2022, 7:26pm UTC](https://discourse.julialang.org/t/how-to-access-change-a-parameter-inside-loop/88747 "2022-10-14T19:26:13Z")

</div>

As variables are local inside while/ for loop in Julia, I was wondering how to see the changes that happen inside loop and then use the values after changes?? For example, consider a very simple implementation of raisin…

---

## [Print.(v) for vector of custom structure?](https://discourse.julialang.org/t/print-v-for-vector-of-custom-structure/88699)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 17\
**Last updated:** [October 14, 2022, 6:51pm UTC](https://discourse.julialang.org/t/print-v-for-vector-of-custom-structure/88699 "2022-10-14T18:51:41Z")

</div>

What is going on here? julia\> struct A x::Int end julia\> Base.show(io::IO, a::A) = print(io, "$(a.x)") julia\> v = \[A(1), A(2)\]; julia\> print.(v) 122-element Vector{Nothing}: nothing nothing this …

---

## [Julia spherical harmonics different from python](https://discourse.julialang.org/t/julia-spherical-harmonics-different-from-python/88638)

<div class="topic-metadata">

**Author:** [@Juliapix](https://discourse.julialang.org/u/Juliapix)\
**Replies:** 8\
**Last updated:** [October 14, 2022, 4:11pm UTC](https://discourse.julialang.org/t/julia-spherical-harmonics-different-from-python/88638 "2022-10-14T16:11:46Z")

</div>

I would like to calculate the Spherical Harmonics with Julia. I have done this with the following code: using GSL function radius(x, y, z) return sqrt(x^2 + y^2 + z^2) end function theta(x, y, z) return acos(z…

---

## [Reduce DataFrame by unique value](https://discourse.julialang.org/t/reduce-dataframe-by-unique-value/88723)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 5\
**Last updated:** [October 14, 2022, 12:09pm UTC](https://discourse.julialang.org/t/reduce-dataframe-by-unique-value/88723 "2022-10-14T12:09:35Z")

</div>

Hi all, I have a large DataFrame with a column of values and a unique id. I would like to create a new DataFrame of the unique values in one column, and a vector of the corresponding ids in another column. Here is an ex…

---

## [GLMakie. 2D textured Plane in 3D space](https://discourse.julialang.org/t/glmakie-2d-textured-plane-in-3d-space/88668)

<div class="topic-metadata">

**Author:** [@LeN3rd](https://discourse.julialang.org/u/LeN3rd)\
**Replies:** 5\
**Last updated:** [October 14, 2022, 11:20am UTC](https://discourse.julialang.org/t/glmakie-2d-textured-plane-in-3d-space/88668 "2022-10-14T11:20:45Z")

</div>

This might be a stupid question, but i want to have a simple 2d textured plane that sits in 3d space, rendered with Makie. Eventually there should be more complex 3D Meshes, but for now i struggle to even get a textured …

---

## [Group by Multi Column Dataframe to share ID? Maybe?](https://discourse.julialang.org/t/group-by-multi-column-dataframe-to-share-id-maybe/88692)

<div class="topic-metadata">

**Author:** [@theboiwholived](https://discourse.julialang.org/u/theboiwholived)\
**Replies:** 6\
**Last updated:** [October 14, 2022, 11:37am UTC](https://discourse.julialang.org/t/group-by-multi-column-dataframe-to-share-id-maybe/88692 "2022-10-14T11:37:04Z")

</div>

Hey ladies and gents! I’ve been searching high and low for the best way to do a multi column groupby, i think. Essentially i have a dataframe. with a multitude of columns but only 2 that matter in this contex. I do a …

---

## [Is there a way to force modification of the binded object instead of rebind to a new object?](https://discourse.julialang.org/t/is-there-a-way-to-force-modification-of-the-binded-object-instead-of-rebind-to-a-new-object/88724)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [October 14, 2022, 11:35am UTC](https://discourse.julialang.org/t/is-there-a-way-to-force-modification-of-the-binded-object-instead-of-rebind-to-a-new-object/88724 "2022-10-14T11:35:37Z")

</div>

When you have a variable that points to a mutable object and you use the equal operator, Julia will simply rebind that variable to the new object. For example, in the following snippet, the objects binded by a and b do …

---

## [Classifiers - Development Status for packages](https://discourse.julialang.org/t/classifiers-development-status-for-packages/88722)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 0\
**Last updated:** [October 14, 2022, 10:15am UTC](https://discourse.julialang.org/t/classifiers-development-status-for-packages/88722 "2022-10-14T10:15:41Z")

</div>

There are basically no requirements to register a Julia package (and I believe that’s a good thing), besides having an OSI-approved license. I do see for Python, in PyPI there’s (and I suggest the same for Julia): 1 - …

---

## [JuliaCall segmentation fault](https://discourse.julialang.org/t/juliacall-segmentation-fault/80208)

<div class="topic-metadata">

**Author:** [@cjproud](https://discourse.julialang.org/u/cjproud)\
**Replies:** 5\
**Last updated:** [October 14, 2022, 9:47am UTC](https://discourse.julialang.org/t/juliacall-segmentation-fault/80208 "2022-10-14T09:47:06Z")

</div>

I’ve got a Julia module (which contains compiled Fortran code) which is called in Python using JuliaCall (Guide · PythonCall & JuliaCall), for example within a Python script: from juliacall import Main as jl jl.seval(us…

---

## [Single string on multiple lines without \`\\n\`](https://discourse.julialang.org/t/single-string-on-multiple-lines-without-n/18099)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 6\
**Last updated:** [October 14, 2022, 9:09am UTC](https://discourse.julialang.org/t/single-string-on-multiple-lines-without-n/18099 "2022-10-14T09:09:14Z")

</div>

Is there a way to continue a single string on multiple lines without inserting \\n into the string? For example "a#some character here b" "ab" The only methods I currently know of is string("a", "b") I was wonder…

---

## [Where are Julia packages installed?](https://discourse.julialang.org/t/where-are-julia-packages-installed/88710)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 5\
**Last updated:** [October 14, 2022, 8:50am UTC](https://discourse.julialang.org/t/where-are-julia-packages-installed/88710 "2022-10-14T08:50:44Z")

</div>

I occasionally find myself wondering where packages are installed and fail to easily find the answer, so I’m putting it here.

---

## [TemporalGPs precise zero estimate](https://discourse.julialang.org/t/temporalgps-precise-zero-estimate/87775)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 7\
**Last updated:** [October 14, 2022, 7:48am UTC](https://discourse.julialang.org/t/temporalgps-precise-zero-estimate/87775 "2022-10-14T07:48:09Z")

</div>

Hi @willtebbutt I’m trying to use TemporalGPs and I wonder if you might have a moment to address an issue I’m having. The data have about 460 observations for each of 15 values of x, for a total of about 6900 observatio…

---

## [Nested expressions rules seem different when \`$\` involved](https://discourse.julialang.org/t/nested-expressions-rules-seem-different-when-involved/82732)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 2\
**Last updated:** [October 14, 2022, 2:51am UTC](https://discourse.julialang.org/t/nested-expressions-rules-seem-different-when-involved/82732 "2022-10-14T02:51:56Z")

</div>

So normally when nesting an expression into an expression, it seems like it doesn’t matter if the latter is written as a quoted :( \_\_\_ ) or an Expr(:quote, \_\_\_ ). There’s a difference when the former is written as a quo…

---

## [Multithreading & Ccall & WIGXJPF](https://discourse.julialang.org/t/multithreading-ccall-wigxjpf/88697)

<div class="topic-metadata">

**Author:** [@wes648](https://discourse.julialang.org/u/wes648)\
**Replies:** 0\
**Last updated:** [October 13, 2022, 10:39pm UTC](https://discourse.julialang.org/t/multithreading-ccall-wigxjpf/88697 "2022-10-13T22:39:15Z")

</div>

Hello! I’m trying to modify the WIGXJPF.jl wrapper to make it work with multithreading. Using the code pretty much as is (just adjusting for my personal paths), I get an error reading wigxjpf: Temp array not allocated…

---

## [Apply dictionary (Dict) to many keys at once (broadcast)](https://discourse.julialang.org/t/apply-dictionary-dict-to-many-keys-at-once-broadcast/88674)

<div class="topic-metadata">

**Author:** [@dorn-gerhard](https://discourse.julialang.org/u/dorn-gerhard)\
**Replies:** 3\
**Last updated:** [October 13, 2022, 9:51pm UTC](https://discourse.julialang.org/t/apply-dictionary-dict-to-many-keys-at-once-broadcast/88674 "2022-10-13T21:51:15Z")

</div>

Given a simple dictionary d = Dict(1 =\> "a", 2 =\> "b", 3 =\> "c") Is there a simple way to apply the dictionary to a list / vector / tuple of keys at once? I would like to “translate” a vector of numbers into letters li…

---

## [Invalid subtyping: can only subtype data types (related to symbolics too)](https://discourse.julialang.org/t/invalid-subtyping-can-only-subtype-data-types-related-to-symbolics-too/88683)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 6\
**Last updated:** [October 13, 2022, 8:17pm UTC](https://discourse.julialang.org/t/invalid-subtyping-can-only-subtype-data-types-related-to-symbolics-too/88683 "2022-10-13T20:17:55Z")

</div>

Edit: it was just a syntax error, that is being reported a bit misleadingly and led me astray I was playing with defining convoluted types and stumbled upon this behavior: julia\> struct S{T} \<: AbstractVector{T} where …

---

## [Dicts with more than one key?](https://discourse.julialang.org/t/dicts-with-more-than-one-key/88680)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 5\
**Last updated:** [October 13, 2022, 7:22pm UTC](https://discourse.julialang.org/t/dicts-with-more-than-one-key/88680 "2022-10-13T19:22:59Z")

</div>

Is there a standard way to create a Dict with more than one key? Or one needs to unavoidably create multiple Dicts by hand? Something like (I’m inventing here the notation): letters = Dict{Keys{Char,Char},String}( …

---

## [Optimal Quordle](https://discourse.julialang.org/t/optimal-quordle/88685)

<div class="topic-metadata">

**Author:** [@aaowens](https://discourse.julialang.org/u/aaowens)\
**Replies:** 0\
**Last updated:** [October 13, 2022, 7:05pm UTC](https://discourse.julialang.org/t/optimal-quordle/88685 "2022-10-13T19:05:19Z")

</div>

I’ve seen a lot of Wordle solvers, but I haven’t seen anything for Quordle, which is 4 Wordles at once. I made one using the entropy approach from 3Blue1Brown’s video and used some of the optimizations from this thread R…

---

## [Julia distributed and multithreaded](https://discourse.julialang.org/t/julia-distributed-and-multithreaded/88649)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 14\
**Last updated:** [October 13, 2022, 6:57pm UTC](https://discourse.julialang.org/t/julia-distributed-and-multithreaded/88649 "2022-10-13T18:57:53Z")

</div>

In my code I leverage multithreading through the use of things like Threads.@threads and by starting julia with Julia --threads=auto. Alongside my code I now wish to utilise Juniper.jl which utilises distributed computin…

---

## [FloatingTableView with Jupyter Notebook?](https://discourse.julialang.org/t/floatingtableview-with-jupyter-notebook/88659)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 7\
**Last updated:** [October 13, 2022, 5:33pm UTC](https://discourse.julialang.org/t/floatingtableview-with-jupyter-notebook/88659 "2022-10-13T17:33:30Z")

</div>

FloatingTableView is a cool package for the console, but it doesn’t seem to work within a Jupyter Notebook (either using Jupytern or VSCode). Is there any way to get it working, or any alternatives for Notebook? Thank…

---

## [How to speed up rowsum function?](https://discourse.julialang.org/t/how-to-speed-up-rowsum-function/88664)

<div class="topic-metadata">

**Author:** [@Strange\_Xue](https://discourse.julialang.org/u/Strange_Xue)\
**Replies:** 6\
**Last updated:** [October 13, 2022, 4:57pm UTC](https://discourse.julialang.org/t/how-to-speed-up-rowsum-function/88664 "2022-10-13T16:57:40Z")

</div>

There is a rowsum function in R, it’s very helpful and fast when constructing some likelihood function, rowsum can apply a function to a group subsetted from a matrix then concatenate these resulted vectors to a new mat…

---

## [Type Parameterization of Elements based on \`FixedPointNumber.jl\` in a Function](https://discourse.julialang.org/t/type-parameterization-of-elements-based-on-fixedpointnumber-jl-in-a-function/88636)

<div class="topic-metadata">

**Author:** [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Replies:** 10\
**Last updated:** [October 13, 2022, 4:12pm UTC](https://discourse.julialang.org/t/type-parameterization-of-elements-based-on-fixedpointnumber-jl-in-a-function/88636 "2022-10-13T16:12:34Z")

</div>

I created a function to convert Images.jl’s packed format into a planar format: using Images; function ConverImagePlanarForm( mI :: Matrix{RGB{Normed{U, f}}} ) :: Array{U, 3} where{U \<: Unsigned, f \<: Integer} # Co…

---

## [Julia's stability guarantee (e.g. precompilation and "incremental compilation may be fatally broken for this module")](https://discourse.julialang.org/t/julias-stability-guarantee-e-g-precompilation-and-incremental-compilation-may-be-fatally-broken-for-this-module/88635)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 7\
**Last updated:** [October 13, 2022, 3:59pm UTC](https://discourse.julialang.org/t/julias-stability-guarantee-e-g-precompilation-and-incremental-compilation-may-be-fatally-broken-for-this-module/88635 "2022-10-13T15:59:58Z")

</div>

As far as I know Julia has 1) a syntax guarantee, and 2) an API guarantee (for documented non-experimental stuff) But that doesn’t seem to be enough in practice, for packages. I see some precompilation issues, and worka…

---

## [Is there an isabstract(T) function where T is a DataType?](https://discourse.julialang.org/t/is-there-an-isabstract-t-function-where-t-is-a-datatype/4165)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 18\
**Last updated:** [October 13, 2022, 2:49pm UTC](https://discourse.julialang.org/t/is-there-an-isabstract-t-function-where-t-is-a-datatype/4165 "2022-10-13T14:49:06Z")

</div>

I wonder if there is a function that returns whether a type T is abstract or not. Any idea? I am trying to make a generator that returns all concrete types of a specific abstract type, and I need to check whether a certa…

---

## [Passing keyword arguments to nested functions | or how to use macros to define a function whose kwargs are those of their inner function calls](https://discourse.julialang.org/t/passing-keyword-arguments-to-nested-functions-or-how-to-use-macros-to-define-a-function-whose-kwargs-are-those-of-their-inner-function-calls/88671)

<div class="topic-metadata">

**Author:** [@abelsiqueira](https://discourse.julialang.org/u/abelsiqueira)\
**Replies:** 0\
**Last updated:** [October 13, 2022, 2:48pm UTC](https://discourse.julialang.org/t/passing-keyword-arguments-to-nested-functions-or-how-to-use-macros-to-define-a-function-whose-kwargs-are-those-of-their-inner-function-calls/88671 "2022-10-13T14:48:41Z")

</div>

Important: I am trying to figure this out to compare to a Python approach, which I mention in the second part of the question. Suppose I have two functions, foo and bar, whose keyword argument I don’t know or care. Sup…

---

## [Missing \<= 2 \<= 3 does not work](https://discourse.julialang.org/t/missing-2-3-does-not-work/88658)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 5\
**Last updated:** [October 13, 2022, 2:32pm UTC](https://discourse.julialang.org/t/missing-2-3-does-not-work/88658 "2022-10-13T14:32:10Z")

</div>

julia\> f() = missing \<= 2 \<= 3 f (generic function with 1 method) julia\> @code\_lowered f() CodeInfo( 1 ─ %1 = Main.missing \<= 2 └── goto #3 if not %1 2 ─ %3 = 2 \<= 3 └── return %3 3 ─ return false…

---

## [Vector of vectors supertype](https://discourse.julialang.org/t/vector-of-vectors-supertype/88666)

<div class="topic-metadata">

**Author:** [@qassiov](https://discourse.julialang.org/u/qassiov)\
**Replies:** 4\
**Last updated:** [October 13, 2022, 2:05pm UTC](https://discourse.julialang.org/t/vector-of-vectors-supertype/88666 "2022-10-13T14:05:24Z")

</div>

I would like to define a function that takes arguments of the type Vector{Vector{Float64}} but is also not restricted to just Float64s (e.g. it should also be able take arguments of type Vector{Vector{Int64}}). However,…

---

## [Reading Text file using Sparse Matrix Format](https://discourse.julialang.org/t/reading-text-file-using-sparse-matrix-format/88665)

<div class="topic-metadata">

**Author:** [@nosewitz](https://discourse.julialang.org/u/nosewitz)\
**Replies:** 0\
**Last updated:** [October 13, 2022, 1:44pm UTC](https://discourse.julialang.org/t/reading-text-file-using-sparse-matrix-format/88665 "2022-10-13T13:44:21Z")

</div>

I have some data inside a text file encoded in the sparse matrix format, meaning that only the indices of non-zero entries are recorded. The first training entry is the following: 0 96 183 367 379 387 1041 1117 1176 13…

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

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