# New to Julia

**URL:** https://discourse.julialang.org/c/first-steps/8.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

---

## [Iteration counter](https://discourse.julialang.org/t/iteration-counter/122394)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 3\
**Last updated:** [November 8, 2024, 5:56pm UTC](https://discourse.julialang.org/t/iteration-counter/122394 "2024-11-08T17:56:59Z")

</div>

Hi, I want to track the load steps in my code using gridap but i got operation cell field out of this code and I cant get the values. Is this way right to implement this? Also I added this print lines to check the proce…

---

## [Strange text output from running Julia tests](https://discourse.julialang.org/t/strange-text-output-from-running-julia-tests/122379)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 9\
**Last updated:** [November 8, 2024, 1:02pm UTC](https://discourse.julialang.org/t/strange-text-output-from-running-julia-tests/122379 "2024-11-08T13:02:52Z")

</div>

I’m getting this somewhat mysterious output when running some of my Julia tests. I don’t recall seeing this yesterday. Test.DefaultTestSet("someModule", Any\[\], 8, false, false, true, 1.730981062858112e9, 1.7309810628609…

---

## [Is there a package for monitoring Julia CPU mean usage?](https://discourse.julialang.org/t/is-there-a-package-for-monitoring-julia-cpu-mean-usage/117094)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 2\
**Last updated:** [November 8, 2024, 10:57am UTC](https://discourse.julialang.org/t/is-there-a-package-for-monitoring-julia-cpu-mean-usage/117094 "2024-11-08T10:57:13Z")

</div>

Julia doesn’t seem to exist and thus doesn’t report CPU usage. I do not know if it is an issue related to the .sh script or to Julia Pardon-me if it is not Julia related, and let me know, I’ll ask StackExchange instead. …

---

## [Preferred implementation of a lookup table](https://discourse.julialang.org/t/preferred-implementation-of-a-lookup-table/116267)

<div class="topic-metadata">

**Author:** [@Matthijs\_1971](https://discourse.julialang.org/u/Matthijs_1971)\
**Replies:** 10\
**Last updated:** [November 6, 2024, 11:45pm UTC](https://discourse.julialang.org/t/preferred-implementation-of-a-lookup-table/116267 "2024-11-06T23:45:37Z")

</div>

Here is some code that studies performances of some implementations of effectively a lookup table. #!/usr/bin/env julia import BenchmarkTools module Enums @enum COLORS begin RED GREEN BLUE …

---

## [Plotting on Raspberry Pi](https://discourse.julialang.org/t/plotting-on-raspberry-pi/24122)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 7\
**Last updated:** [November 7, 2024, 1:47pm UTC](https://discourse.julialang.org/t/plotting-on-raspberry-pi/24122 "2024-11-07T13:47:56Z")

</div>

Hi, I’m exploring the use of Julia for prototyping of embedded systems on Raspberry Pi (yes, that’s a bit of a niche) and would like to know if anyone has plotting working (other than UnicodePlots) on the Raspberry Pi. I…

---

## [Why does append!(df1, df2) return a DataFrame, as well as modify the argument df1?](https://discourse.julialang.org/t/why-does-append-df1-df2-return-a-dataframe-as-well-as-modify-the-argument-df1/122329)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 22\
**Last updated:** [November 7, 2024, 1:03pm UTC](https://discourse.julialang.org/t/why-does-append-df1-df2-return-a-dataframe-as-well-as-modify-the-argument-df1/122329 "2024-11-07T13:03:21Z")

</div>

It seems like the append! function, as defined in the DataFrames package both returns a value and modifies the value of one of its arguments. This seems strange and I am struggling to understand why this happens. I pic…

---

## [@threads vs @spawn](https://discourse.julialang.org/t/threads-vs-spawn/51168)

<div class="topic-metadata">

**Author:** [@Bryan\_So](https://discourse.julialang.org/u/Bryan_So)\
**Replies:** 9\
**Last updated:** [November 7, 2024, 12:29pm UTC](https://discourse.julialang.org/t/threads-vs-spawn/51168 "2024-11-07T12:29:28Z")

</div>

Hi, would appreciate some feedback about this issue. I’m trying to understand the difference between @threads and @spawn. I think the former is easy to understand. I have an experiment shuffling cards, many many times…

---

## [How can I change the Pluto notebook theme?](https://discourse.julialang.org/t/how-can-i-change-the-pluto-notebook-theme/122333)

<div class="topic-metadata">

**Author:** [@selinguler94](https://discourse.julialang.org/u/selinguler94)\
**Replies:** 3\
**Last updated:** [November 7, 2024, 8:52am UTC](https://discourse.julialang.org/t/how-can-i-change-the-pluto-notebook-theme/122333 "2024-11-07T08:52:53Z")

</div>

I genuinely failed to change the theme and I need help.

---

## [Splat operator](https://discourse.julialang.org/t/splat-operator/122351)

<div class="topic-metadata">

**Author:** [@martin\_sanchez](https://discourse.julialang.org/u/martin_sanchez)\
**Replies:** 3\
**Last updated:** [November 6, 2024, 8:03pm UTC](https://discourse.julialang.org/t/splat-operator/122351 "2024-11-06T20:03:39Z")

</div>

Going to edit the question: My doubt is why, even when I use the splat operator in a function definition, I can still refer to it as an iterator. To be more concrete: function mysum(args...) sum=0 for i in args …

---

## [Calling a Python script with PyCall](https://discourse.julialang.org/t/calling-a-python-script-with-pycall/36018)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 6\
**Last updated:** [November 6, 2024, 6:50am UTC](https://discourse.julialang.org/t/calling-a-python-script-with-pycall/36018 "2024-11-06T06:50:26Z")

</div>

I have some old Python set of scripts, and would like to call a function (just one function) from there into Julia. How can I do it? Win10, conda. using PyCall pushfirst!(PyVector(pyimport("sys")."path"), "") mys = pyi…

---

## [DataFrames and sorting - is the default sort a stable sort?](https://discourse.julialang.org/t/dataframes-and-sorting-is-the-default-sort-a-stable-sort/122297)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 2\
**Last updated:** [November 5, 2024, 5:54pm UTC](https://discourse.julialang.org/t/dataframes-and-sorting-is-the-default-sort-a-stable-sort/122297 "2024-11-05T17:54:07Z")

</div>

Here’s a link to the documentation page on DataFrames and sorting. Sorting · DataFrames.jl Some details are provided here, but unfortunately the information as to whether the default sorting algorithm is a stable sort…

---

## [Can we compile a list of useful Julia debugging macros and functions?](https://discourse.julialang.org/t/can-we-compile-a-list-of-useful-julia-debugging-macros-and-functions/122288)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 4\
**Last updated:** [November 5, 2024, 3:47pm UTC](https://discourse.julialang.org/t/can-we-compile-a-list-of-useful-julia-debugging-macros-and-functions/122288 "2024-11-05T15:47:37Z")

</div>

While learning Julia, I have noticed there are a few useful macros and functions which can be used to inspect functions, decipher which functions or methods are being called, query methods for types, among other similar …

---

## [Scope and structure for unit test files](https://discourse.julialang.org/t/scope-and-structure-for-unit-test-files/122278)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 4\
**Last updated:** [November 5, 2024, 2:17pm UTC](https://discourse.julialang.org/t/scope-and-structure-for-unit-test-files/122278 "2024-11-05T14:17:19Z")

</div>

I have a query about how to structure the contents of a unit test file. In many cases, ideally, for each test we will have an independent scope. This is to prevent information leakage between different test cases. The …

---

## [Is there a function to query what has been imported into the current module/namespace from \`export\` statements in other modules?](https://discourse.julialang.org/t/is-there-a-function-to-query-what-has-been-imported-into-the-current-module-namespace-from-export-statements-in-other-modules/122218)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 3\
**Last updated:** [November 5, 2024, 3:14am UTC](https://discourse.julialang.org/t/is-there-a-function-to-query-what-has-been-imported-into-the-current-module-namespace-from-export-statements-in-other-modules/122218 "2024-11-05T03:14:18Z")

</div>

Here’s a couple of things I have tried: julia\> using Dates julia\> names(Main) 6-element Vector{Symbol}: :Base :Core :Main :SRC :skipInit :updateLoadPath This didn’t print anything relating to the Dates module, o…

---

## [ERROR: using Cholesky decomposition when using Turing.jl Bayesien inference](https://discourse.julialang.org/t/error-using-cholesky-decomposition-when-using-turing-jl-bayesien-inference/122199)

<div class="topic-metadata">

**Author:** [@sofiane](https://discourse.julialang.org/u/sofiane)\
**Replies:** 1\
**Last updated:** [November 4, 2024, 8:17pm UTC](https://discourse.julialang.org/t/error-using-cholesky-decomposition-when-using-turing-jl-bayesien-inference/122199 "2024-11-04T20:17:52Z")

</div>

Hi everyone, i’am sharing my code snippet where i try to do some bayesien inference like here @model IPPModel() = begin #assign priors for the SPDE layer μ₁ ~ L₁priors.μprior l₁ ~ L₁priors.lprior σ₁ ~ L₁priors.σprio…

---

## [Does Julia have efficient move semantics?](https://discourse.julialang.org/t/does-julia-have-efficient-move-semantics/122165)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 47\
**Last updated:** [November 4, 2024, 3:39pm UTC](https://discourse.julialang.org/t/does-julia-have-efficient-move-semantics/122165 "2024-11-04T15:39:10Z")

</div>

This question might be a stupid question. If it is, I haven’t realized why. Does Julia have efficient move semantics? Consider the following example, which is a stupid example, but it’s also a simple example. v::Vecto…

---

## [Using ImageInTerminal cause immediate printing](https://discourse.julialang.org/t/using-imageinterminal-cause-immediate-printing/121494)

<div class="topic-metadata">

**Author:** [@sakke](https://discourse.julialang.org/u/sakke)\
**Replies:** 10\
**Last updated:** [November 4, 2024, 1:08pm UTC](https://discourse.julialang.org/t/using-imageinterminal-cause-immediate-printing/121494 "2024-11-04T13:08:55Z")

</div>

This happens both in REPL and while running program from command line. In REPL, without doing anything else, the second command row is filled automatically. julia\> using ImageInTerminal julia\> 61;6;7;21;22;23;24;28;32;…

---

## [Updating plots in Julia](https://discourse.julialang.org/t/updating-plots-in-julia/122024)

<div class="topic-metadata">

**Author:** [@DCaro45](https://discourse.julialang.org/u/DCaro45)\
**Replies:** 8\
**Last updated:** [November 4, 2024, 10:59am UTC](https://discourse.julialang.org/t/updating-plots-in-julia/122024 "2024-11-04T10:59:54Z")

</div>

I’m updating a scatter plot with new points as my simulation runs and I need to loop over a certain parameter and have a few plots on my graph. I’m just struggling with trying to have a legend that can update with each p…

---

## [Is there a reason \*\*\*not\*\*\* to explicitly define return types?](https://discourse.julialang.org/t/is-there-a-reason-not-to-explicitly-define-return-types/122142)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 35\
**Last updated:** [November 3, 2024, 9:53pm UTC](https://discourse.julialang.org/t/is-there-a-reason-not-to-explicitly-define-return-types/122142 "2024-11-03T21:53:39Z")

</div>

Allow me to summarize the findings of my research so far: Julia is able to automatically infer the return type from: Do you put return type in function definitions? This is true, however I do not see that this is a re…

---

## [What is Memory? Does it have a documentation page?](https://discourse.julialang.org/t/what-is-memory-does-it-have-a-documentation-page/122164)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 9\
**Last updated:** [November 3, 2024, 4:48pm UTC](https://discourse.julialang.org/t/what-is-memory-does-it-have-a-documentation-page/122164 "2024-11-03T16:48:32Z")

</div>

I have been looking at the source for Dict.jl to see how Dictionaries are implemented in Julia. julia/base/dict.jl at 8f5b7ca12ad48c6d740e058312fc8cf2bbe67848 · JuliaLang/julia · GitHub I can see that Dict is implemen…

---

## [How to process a dictionary with multi tasking?](https://discourse.julialang.org/t/how-to-process-a-dictionary-with-multi-tasking/122186)

<div class="topic-metadata">

**Author:** [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Replies:** 9\
**Last updated:** [November 3, 2024, 1:45pm UTC](https://discourse.julialang.org/t/how-to-process-a-dictionary-with-multi-tasking/122186 "2024-11-03T13:45:47Z")

</div>

Hello I have a dictionary that I currently process this way: a = pairs(tiledict) foreach(a) do paire # some stuff goes here using paire\[1\] and paire\[2\] end I have to go through the whole dictionary. It does the wo…

---

## [Still another type conversion problem](https://discourse.julialang.org/t/still-another-type-conversion-problem/122188)

<div class="topic-metadata">

**Author:** [@vsoler](https://discourse.julialang.org/u/vsoler)\
**Replies:** 3\
**Last updated:** [November 3, 2024, 2:26am UTC](https://discourse.julialang.org/t/still-another-type-conversion-problem/122188 "2024-11-03T02:26:00Z")

</div>

I have created a DataFrame with a column “C” full of missing values which I intend to fill in afterwards with Floats64. I try to convert column “C” to Union{Float64, Missing} but Julia does not convert anything. The…

---

## [Defining an outer constructor leads to infinite recursion](https://discourse.julialang.org/t/defining-an-outer-constructor-leads-to-infinite-recursion/122090)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 15\
**Last updated:** [November 2, 2024, 11:35am UTC](https://discourse.julialang.org/t/defining-an-outer-constructor-leads-to-infinite-recursion/122090 "2024-11-02T11:35:56Z")

</div>

This question really has two parts I have observed that defining an outer constructor leads to infinite recursion I understand why this is happening, but I do not know if I am doing something obviously stupid, which c…

---

## [Julia equivalent of the \`.venv\` folder when working with Pkg and environments](https://discourse.julialang.org/t/julia-equivalent-of-the-venv-folder-when-working-with-pkg-and-environments/122123)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 11\
**Last updated:** [November 2, 2024, 10:33am UTC](https://discourse.julialang.org/t/julia-equivalent-of-the-venv-folder-when-working-with-pkg-and-environments/122123 "2024-11-02T10:33:19Z")

</div>

I have realized I am a little confused about one aspect of the behavior of Pkg. In Python, local virtual environments are provided by venv. (Other tools also exist.) You use Python to run venv, which is a globally acce…

---

## [Is there a way to read a DataFrame from file specifying the type of each column?](https://discourse.julialang.org/t/is-there-a-way-to-read-a-dataframe-from-file-specifying-the-type-of-each-column/122146)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 7\
**Last updated:** [November 1, 2024, 7:37pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-read-a-dataframe-from-file-specifying-the-type-of-each-column/122146 "2024-11-01T19:37:19Z")

</div>

Here is some code which reads a DataFrame from a (csv) file: using DataFrames using CSV df = DataFrame(CSV.File(filename)) By default, I think the columns are String type. (Maybe it is inferred from the data values?) …

---

## [Understanding Julia Environments - Project Environment and Package Directory](https://discourse.julialang.org/t/understanding-julia-environments-project-environment-and-package-directory/122082)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 9\
**Last updated:** [November 1, 2024, 2:59pm UTC](https://discourse.julialang.org/t/understanding-julia-environments-project-environment-and-package-directory/122082 "2024-11-01T14:59:13Z")

</div>

I am trying to understand this documentation page which is related to code loading in Julia. Under the Environment section, there are two types of environment listed. Project Environment Package Directory I don’t u…

---

## [Why isn't this legal syntax for defining a subtype?](https://discourse.julialang.org/t/why-isnt-this-legal-syntax-for-defining-a-subtype/121479)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 16\
**Last updated:** [November 1, 2024, 9:43am UTC](https://discourse.julialang.org/t/why-isnt-this-legal-syntax-for-defining-a-subtype/121479 "2024-11-01T09:43:14Z")

</div>

I have some abstract type parameterised by a T type like this abstract type SomeAbstractType{T} end and I want to create a subtype from it and this syntax works mutable struct Some{T\<:Number} \<: SomeAbstractType{T} …

---

## [Symbolically solving a system of equations... "Matrix is not square" error](https://discourse.julialang.org/t/symbolically-solving-a-system-of-equations-matrix-is-not-square-error/122093)

<div class="topic-metadata">

**Author:** [@Someguy](https://discourse.julialang.org/u/Someguy)\
**Replies:** 6\
**Last updated:** [November 1, 2024, 8:37am UTC](https://discourse.julialang.org/t/symbolically-solving-a-system-of-equations-matrix-is-not-square-error/122093 "2024-11-01T08:37:41Z")

</div>

I’m trying to find Requ(ivalent) for a circuit in terms of the 5 resistors in the circuit. I’ve written out the equations for the circuit as follows: using Symbolics @variables i1 i2 i3 i4 i5 iIn; equ1= iIn ~ i1 + i4 e…

---

## [How do I set bounds for a parametric subtype of a parametric abstract type?](https://discourse.julialang.org/t/how-do-i-set-bounds-for-a-parametric-subtype-of-a-parametric-abstract-type/122101)

<div class="topic-metadata">

**Author:** [@martin\_sanchez](https://discourse.julialang.org/u/martin_sanchez)\
**Replies:** 3\
**Last updated:** [November 1, 2024, 3:49am UTC](https://discourse.julialang.org/t/how-do-i-set-bounds-for-a-parametric-subtype-of-a-parametric-abstract-type/122101 "2024-11-01T03:49:45Z")

</div>

In theory, the use of Dummy{T} without explicitly declaring a “scope” for T, would mean that Dummy is an abstract type. But if I try to make an abstract type with that structure: julia\> abstract type Dummy{T} end It wo…

---

## [Broadcasting question](https://discourse.julialang.org/t/broadcasting-question/122092)

<div class="topic-metadata">

**Author:** [@lancejnelson](https://discourse.julialang.org/u/lancejnelson)\
**Replies:** 4\
**Last updated:** [October 31, 2024, 8:15pm UTC](https://discourse.julialang.org/t/broadcasting-question/122092 "2024-10-31T20:15:14Z")

</div>

I’m trying to calculate the following: where v and \\hat{n} vectors of length 3. But I need to do this to a bunch of vectors stored in a Vector{Vector{SVector{3,Float64}}} I ended up doing it like this: dots = \[\[ve…

[Previous page](https://discourse.julialang.org/c/first-steps/8.md?page=28)

[Next page](https://discourse.julialang.org/c/first-steps/8.md?page=30)
