# New to Julia

**URL:** https://discourse.julialang.org/c/first-steps/8.md?page=47

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

**Page:** 48

---

## [How to directly load a JPEG image directly from URL into Luxor](https://discourse.julialang.org/t/how-to-directly-load-a-jpeg-image-directly-from-url-into-luxor/113578)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 2\
**Last updated:** [April 29, 2024, 10:34am UTC](https://discourse.julialang.org/t/how-to-directly-load-a-jpeg-image-directly-from-url-into-luxor/113578 "2024-04-29T10:34:30Z")

</div>

I have figured out how to load a PNG image directly into Luxor. My solution is crude but it works. using Luxor using HTTP dir\_temp\_name = tempname() println("dir\_temp\_name is ",dir\_temp\_name) file\_temp\_name = HTTP.downl…

---

## [How to broadcast for 3d-array?](https://discourse.julialang.org/t/how-to-broadcast-for-3d-array/113581)

<div class="topic-metadata">

**Author:** [@Kohei\_Hattori](https://discourse.julialang.org/u/Kohei_Hattori)\
**Replies:** 4\
**Last updated:** [April 28, 2024, 6:07pm UTC](https://discourse.julialang.org/t/how-to-broadcast-for-3d-array/113581 "2024-04-28T18:07:42Z")

</div>

This is a very amateur question, but how can I make the code to output a three-dimensional array when I broadcast to a variable like the one in the image in julia? I want the element specified by \[i,j,k\] in the three-dim…

---

## [DataFrames: obtaining the subset of rows by a set of values](https://discourse.julialang.org/t/dataframes-obtaining-the-subset-of-rows-by-a-set-of-values/15923)

<div class="topic-metadata">

**Author:** [@Luis\_de\_Sousa](https://discourse.julialang.org/u/Luis_de_Sousa)\
**Replies:** 45\
**Last updated:** [April 27, 2024, 9:32pm UTC](https://discourse.julialang.org/t/dataframes-obtaining-the-subset-of-rows-by-a-set-of-values/15923 "2024-04-27T21:32:33Z")

</div>

Hi everyone, I would like to perform an operation similar to the SQL SELECT \* FROM table WHERE col IN ("1","2","3") on a DataFrame. I have an array with a few strings that I wish to use in this selection. From what I ha…

---

## [Replacing brackets in a string](https://discourse.julialang.org/t/replacing-brackets-in-a-string/85478)

<div class="topic-metadata">

**Author:** [@james3](https://discourse.julialang.org/u/james3)\
**Replies:** 7\
**Last updated:** [April 27, 2024, 8:53pm UTC](https://discourse.julialang.org/t/replacing-brackets-in-a-string/85478 "2024-04-27T20:53:37Z")

</div>

I have a string such as str = "MyFunction\[x\] = ...", where x is a value. How do I replace the square brackets with parentheses such that str contains "MyFunction(x) = ..."? There can be may different values x, and in my …

---

## [How to do multi-dimension integration with BigFloat?](https://discourse.julialang.org/t/how-to-do-multi-dimension-integration-with-bigfloat/113485)

<div class="topic-metadata">

**Author:** [@baizhan](https://discourse.julialang.org/u/baizhan)\
**Replies:** 2\
**Last updated:** [April 27, 2024, 3:59pm UTC](https://discourse.julialang.org/t/how-to-do-multi-dimension-integration-with-bigfloat/113485 "2024-04-27T15:59:29Z")

</div>

Hello, I want to calculate a multiple dimension integration, and I have to use high precision float. I have tried HCubature, which is a pure-julia implementation of integration. But when I use BigFloat as input, it wi…

---

## [Behavior of \\circ\<tab\>](https://discourse.julialang.org/t/behavior-of-circ-tab/113560)

<div class="topic-metadata">

**Author:** [@d\_b](https://discourse.julialang.org/u/d_b)\
**Replies:** 2\
**Last updated:** [April 27, 2024, 10:24am UTC](https://discourse.julialang.org/t/behavior-of-circ-tab/113560 "2024-04-27T10:24:52Z")

</div>

Inside “manual/functions” under “Function composition and piping”, the first example of using \\circ\<tab\> is julia\> (sqrt \\circ\<tab\> +)(3, 6) which evaluates to 3.0. However, when I try to do the same thing with \\sqrt\<t…

---

## [My script fails at \`using\`](https://discourse.julialang.org/t/my-script-fails-at-using/113540)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 2\
**Last updated:** [April 26, 2024, 9:48pm UTC](https://discourse.julialang.org/t/my-script-fails-at-using/113540 "2024-04-26T21:48:08Z")

</div>

I don’t understand environments. :worried: I’ve been avoiding trying to understand them for a while and just using Pkg.add willi-nilli. However, this morning I started getting new and unexpected issues without seeming…

---

## [Create grouped dataframe by properties of a given column?](https://discourse.julialang.org/t/create-grouped-dataframe-by-properties-of-a-given-column/113360)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 9\
**Last updated:** [April 26, 2024, 3:26pm UTC](https://discourse.julialang.org/t/create-grouped-dataframe-by-properties-of-a-given-column/113360 "2024-04-26T15:26:38Z")

</div>

Hi just wondering if there a way to group a DataFrame by properties within a column. E.g. Suppose julia\> df = DataFrame(date = Date(2024,3,25): Day(1):Date(2024,4,5)) 12×1 DataFrame Row │ date │ Date …

---

## [Function definitions with where T undefined](https://discourse.julialang.org/t/function-definitions-with-where-t-undefined/113529)

<div class="topic-metadata">

**Author:** [@LucasMontoya4](https://discourse.julialang.org/u/LucasMontoya4)\
**Replies:** 4\
**Last updated:** [April 26, 2024, 12:27pm UTC](https://discourse.julialang.org/t/function-definitions-with-where-t-undefined/113529 "2024-04-26T12:27:00Z")

</div>

Hi there, after looking at pieces of code around the internet, I have occasionally seen codes where functions are defined with function foo(x, v::T) where T, or something like that. I don’t understand the point of this w…

---

## [Partial Autodiff in NN using Flux](https://discourse.julialang.org/t/partial-autodiff-in-nn-using-flux/69016)

<div class="topic-metadata">

**Author:** [@gnicolosi](https://discourse.julialang.org/u/gnicolosi)\
**Replies:** 1\
**Last updated:** [April 25, 2024, 9:17am UTC](https://discourse.julialang.org/t/partial-autodiff-in-nn-using-flux/69016 "2024-04-25T09:17:12Z")

</div>

I have been using Flux to model a NN which has a loss function dependent on its own NN output and other functions that contains functions also dependent on the output of the NN, in a sort of recurrent way. My data is jus…

---

## [PyPlot does not show me any plot](https://discourse.julialang.org/t/pyplot-does-not-show-me-any-plot/113438)

<div class="topic-metadata">

**Author:** [@Andrea\_Demaria](https://discourse.julialang.org/u/Andrea_Demaria)\
**Replies:** 9\
**Last updated:** [April 24, 2024, 9:59pm UTC](https://discourse.julialang.org/t/pyplot-does-not-show-me-any-plot/113438 "2024-04-24T21:59:53Z")

</div>

I installed Julia 1.9.3 on my windows 11 pc and add the package PyPlot. Then, going in VS code the Julia version is immediately recognize (so okay). Whenever I write using PyPlot all works well, but when I try to make a …

---

## [Combine multiple Arrays into one large dataframe matrix:](https://discourse.julialang.org/t/combine-multiple-arrays-into-one-large-dataframe-matrix/113411)

<div class="topic-metadata">

**Author:** [@GeodeticR](https://discourse.julialang.org/u/GeodeticR)\
**Replies:** 3\
**Last updated:** [April 24, 2024, 7:20pm UTC](https://discourse.julialang.org/t/combine-multiple-arrays-into-one-large-dataframe-matrix/113411 "2024-04-24T19:20:25Z")

</div>

I’ve attempted multiple ways to populate the “missing” values of my DataFrame with the appropriate values, I created the shell of a DataFrame that looks like this: ResVert\_matrix 1826×372 DataFrame Row │ decyr AGM…

---

## [Why do views of offsetarrays have one-based indexing if bounds are specified?](https://discourse.julialang.org/t/why-do-views-of-offsetarrays-have-one-based-indexing-if-bounds-are-specified/24633)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 14\
**Last updated:** [April 24, 2024, 4:52pm UTC](https://discourse.julialang.org/t/why-do-views-of-offsetarrays-have-one-based-indexing-if-bounds-are-specified/24633 "2024-04-24T16:52:17Z")

</div>

The index seems to be one-based or otherwise depending on whether I explicitly specify the lower and upper bounds or leave it implicit. Why is this the case? julia\> a=zeros(-1:1); julia\> b=view(a,-1:1); axes(b) (Base.O…

---

## [ERROR: LoadError: ArgumentError: Package LaplaceRedux does not have MLJBase in its dependencies](https://discourse.julialang.org/t/error-loaderror-argumenterror-package-laplaceredux-does-not-have-mljbase-in-its-dependencies/113250)

<div class="topic-metadata">

**Author:** [@Rockdeldiablo](https://discourse.julialang.org/u/Rockdeldiablo)\
**Replies:** 11\
**Last updated:** [April 24, 2024, 12:30pm UTC](https://discourse.julialang.org/t/error-loaderror-argumenterror-package-laplaceredux-does-not-have-mljbase-in-its-dependencies/113250 "2024-04-24T12:30:48Z")

</div>

Hi, i was trying to make some modifications to the laplaceredux package but i am having some issues with the environment. everything worked until i tried to add MLJBase to the environment, now julia tells me ERROR: Lo…

---

## [Matrix assembly](https://discourse.julialang.org/t/matrix-assembly/111324)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 5\
**Last updated:** [March 7, 2024, 9:17pm UTC](https://discourse.julialang.org/t/matrix-assembly/111324 "2024-03-07T21:17:32Z")

</div>

Hi, I am trying to understand this equation and implementing it in julia. where sigma is second order tensor assuming dimension n1n1. and Nd is shape function matric for scalar value so dimension is 1n2. How this mul…

---

## [Zero order hold interpolation](https://discourse.julialang.org/t/zero-order-hold-interpolation/113430)

<div class="topic-metadata">

**Author:** [@Piyush](https://discourse.julialang.org/u/Piyush)\
**Replies:** 2\
**Last updated:** [April 24, 2024, 10:01am UTC](https://discourse.julialang.org/t/zero-order-hold-interpolation/113430 "2024-04-24T10:01:17Z")

</div>

Is there a way to do a zero order hold interpolations using DataInterpolations.jl

---

## [How to extract box centers from a boxplot (StatsPlots.jl)](https://discourse.julialang.org/t/how-to-extract-box-centers-from-a-boxplot-statsplots-jl/113417)

<div class="topic-metadata">

**Author:** [@JonathanH](https://discourse.julialang.org/u/JonathanH)\
**Replies:** 0\
**Last updated:** [April 24, 2024, 2:32am UTC](https://discourse.julialang.org/t/how-to-extract-box-centers-from-a-boxplot-statsplots-jl/113417 "2024-04-24T02:32:37Z")

</div>

I have some code (attached) for generating a box plot overlayed with a “jitter” plot (Jittered points — geom\_jitter • ggplot2) – that is, each box has a bunch of scatter points that are aligned with it. I am trying to ex…

---

## [Cleaning unnecessary files after building Julia](https://discourse.julialang.org/t/cleaning-unnecessary-files-after-building-julia/110571)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 11\
**Last updated:** [April 23, 2024, 7:07pm UTC](https://discourse.julialang.org/t/cleaning-unnecessary-files-after-building-julia/110571 "2024-04-23T19:07:45Z")

</div>

Hi, I manage to build Julia from source. It seems that the outputs of the build are in a folder called “usr”. In that folder I can see that there are the default folder that comes with a “normal” Julia installation, i.…

---

## [Get the type parameters of a parametric type](https://discourse.julialang.org/t/get-the-type-parameters-of-a-parametric-type/113308)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 12\
**Last updated:** [April 23, 2024, 3:43pm UTC](https://discourse.julialang.org/t/get-the-type-parameters-of-a-parametric-type/113308 "2024-04-23T15:43:35Z")

</div>

I have an instance of a parametric type. Is it possible to somehow retrieve the type parameters for this instance? E.g. for \`\`\`julia struct MyStruct{T} x::T function MyStruct(x) return new{typeof(x)}(x) end end …

---

## [UDE example missing physics MethodError](https://discourse.julialang.org/t/ude-example-missing-physics-methoderror/113334)

<div class="topic-metadata">

**Author:** [@SzAleks](https://discourse.julialang.org/u/SzAleks)\
**Replies:** 1\
**Last updated:** [April 23, 2024, 12:30pm UTC](https://discourse.julialang.org/t/ude-example-missing-physics-methoderror/113334 "2024-04-23T12:30:27Z")

</div>

Hello all, some time ago I reproduced the Automatically Discover Missing Physics by Embedding Machine Learning into Differential Equations · Overview of Julia's SciML example on my local machine for future projects. Some…

---

## [Resize widgets in gtk.jl](https://discourse.julialang.org/t/resize-widgets-in-gtk-jl/113346)

<div class="topic-metadata">

**Author:** [@Votline](https://discourse.julialang.org/u/Votline)\
**Replies:** 0\
**Last updated:** [April 22, 2024, 3:54pm UTC](https://discourse.julialang.org/t/resize-widgets-in-gtk-jl/113346 "2024-04-22T15:54:36Z")

</div>

How can I change the size of the widget or set a fixed value for the window (so that it is not stretched by widgets)? (resize!(win, x, y) does not set a fixed value))

---

## [Display plot in GTK without saving to PNG](https://discourse.julialang.org/t/display-plot-in-gtk-without-saving-to-png/113330)

<div class="topic-metadata">

**Author:** [@C1wan](https://discourse.julialang.org/u/C1wan)\
**Replies:** 1\
**Last updated:** [April 22, 2024, 1:07pm UTC](https://discourse.julialang.org/t/display-plot-in-gtk-without-saving-to-png/113330 "2024-04-22T13:07:13Z")

</div>

Hello, I have an application where I display a plot in a GTK window, but for that I save it in a png with savefig and CairoImageSurface. Now I want do display the plot without saving i to a PNG file. Normally this shou…

---

## [Cannot precompile ReinforcementLearning](https://discourse.julialang.org/t/cannot-precompile-reinforcementlearning/113217)

<div class="topic-metadata">

**Author:** [@cjs](https://discourse.julialang.org/u/cjs)\
**Replies:** 6\
**Last updated:** [April 22, 2024, 3:06am UTC](https://discourse.julialang.org/t/cannot-precompile-reinforcementlearning/113217 "2024-04-22T03:06:30Z")

</div>

I am trying to run a project that uses ReinforcementLearning but cannot get it to precompile. The error message I get is: ERROR: The following 1 direct dependency failed to precompile: ReinforcementLearning \[158674fc-8…

---

## [Run tests on src file change: Best practice](https://discourse.julialang.org/t/run-tests-on-src-file-change-best-practice/19173)

<div class="topic-metadata">

**Author:** [@taqtiqa-mark](https://discourse.julialang.org/u/taqtiqa-mark)\
**Replies:** 9\
**Last updated:** [April 20, 2024, 3:13pm UTC](https://discourse.julialang.org/t/run-tests-on-src-file-change-best-practice/19173 "2024-04-20T15:13:16Z")

</div>

What is the best practice to have Julia run unit-tests automatically when the src code changes? A. Using 3rd party packages. B. Using only Base or Stdlib packages.

---

## [Issues in running tests while exporting struct](https://discourse.julialang.org/t/issues-in-running-tests-while-exporting-struct/113253)

<div class="topic-metadata">

**Author:** [@Spinachboul](https://discourse.julialang.org/u/Spinachboul)\
**Replies:** 1\
**Last updated:** [April 20, 2024, 6:07am UTC](https://discourse.julialang.org/t/issues-in-running-tests-while-exporting-struct/113253 "2024-04-20T06:07:52Z")

</div>

Hi! I am working on a package SGP where I am trying to export the in-struct functions but still getting the error: sgp = SGP() # Create an instance of the SGP clas ERROR: UndefVarError: SGP not defined Stacktrace: \[…

---

## [Stripping parameter from parametric types](https://discourse.julialang.org/t/stripping-parameter-from-parametric-types/8293)

<div class="topic-metadata">

**Author:** [@braydenware](https://discourse.julialang.org/u/braydenware)\
**Replies:** 18\
**Last updated:** [April 19, 2024, 6:13pm UTC](https://discourse.julialang.org/t/stripping-parameter-from-parametric-types/8293 "2024-04-19T18:13:42Z")

</div>

I have writing code that maniuplates containers of arrays of custom types with several parameters, e.g. SomeArrayType{T, G1, G2, N} \<: AbstractArray{T, N}, where the last parameter in SomeArrayType is always the array r…

---

## [Writing a simple macro for pretty differentiation](https://discourse.julialang.org/t/writing-a-simple-macro-for-pretty-differentiation/113247)

<div class="topic-metadata">

**Author:** [@Bizzi](https://discourse.julialang.org/u/Bizzi)\
**Replies:** 1\
**Last updated:** [April 19, 2024, 4:21pm UTC](https://discourse.julialang.org/t/writing-a-simple-macro-for-pretty-differentiation/113247 "2024-04-19T16:21:14Z")

</div>

Trying to write my first macro and I’m surprised at just how hard it really is. My goal is simple. I would like to be able to write something like the following @∂(t)f(t,x,y) and have it mean AD.derivative(z -\> f(z,…

---

## [Julia Error: InitError when trying to use Plots in Python via JuliaCall](https://discourse.julialang.org/t/julia-error-initerror-when-trying-to-use-plots-in-python-via-juliacall/112425)

<div class="topic-metadata">

**Author:** [@fumikobayashi](https://discourse.julialang.org/u/fumikobayashi)\
**Replies:** 2\
**Last updated:** [April 19, 2024, 7:38am UTC](https://discourse.julialang.org/t/julia-error-initerror-when-trying-to-use-plots-in-python-via-juliacall/112425 "2024-04-19T07:38:04Z")

</div>

Hello, I am trying to use the Julia package Plots.jl in Python3.11 via the JuliaCall package on Ubuntu 22.04.4 LTS. (Actually, I try to use another package that is developing a local community but I’m suspecting Plots.j…

---

## [Solving Delay differential equation with variable delay](https://discourse.julialang.org/t/solving-delay-differential-equation-with-variable-delay/113137)

<div class="topic-metadata">

**Author:** [@Lucas\_Sarrazin](https://discourse.julialang.org/u/Lucas_Sarrazin)\
**Replies:** 1\
**Last updated:** [April 18, 2024, 12:23pm UTC](https://discourse.julialang.org/t/solving-delay-differential-equation-with-variable-delay/113137 "2024-04-18T12:23:42Z")

</div>

Hi everyone, I am very new to Julia and I want to wrote a code for solving a delay differential equation with variable delay of the form : x’(t) = 1 + y(t) y’(t) = y(t - tau(t)) + y0 with initial conditions xi = 0 an…

---

## [Add a colorbar to a viz in GeoStats](https://discourse.julialang.org/t/add-a-colorbar-to-a-viz-in-geostats/112193)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 24\
**Last updated:** [April 18, 2024, 9:42am UTC](https://discourse.julialang.org/t/add-a-colorbar-to-a-viz-in-geostats/112193 "2024-04-18T09:42:09Z")

</div>

How can I add a colour bar to this map in GeoStat? viz(longt.geometry, color = log10.(longt.rat), colorscheme = colorschemes\[:hawaii\], facetcolor = "black", showfacets=true) Thanks!

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

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