# General Usage

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

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

**Page:** 717

---

## [Misterious appearance of Plots MIME output in Jupyterlab](https://discourse.julialang.org/t/misterious-appearance-of-plots-mime-output-in-jupyterlab/44485)

<div class="topic-metadata">

**Author:** [@alusiani](https://discourse.julialang.org/u/alusiani)\
**Replies:** 1\
**Last updated:** [August 8, 2020, 7:03am UTC](https://discourse.julialang.org/t/misterious-appearance-of-plots-mime-output-in-jupyterlab/44485 "2020-08-08T07:03:52Z")

</div>

I am puzzled by why a plot is shown in Jupyterlab despite I take all precautions for it not to be, when I call savefig(). In short, if I do using Plots plot(range, range.^2); savefig("a.pdf"); nothing in Jupyterlab, …

---

## [How can I display single spaced, multi-line text in Pluto?](https://discourse.julialang.org/t/how-can-i-display-single-spaced-multi-line-text-in-pluto/44483)

<div class="topic-metadata">

**Author:** [@jdad](https://discourse.julialang.org/u/jdad)\
**Replies:** 5\
**Last updated:** [August 8, 2020, 7:49am UTC](https://discourse.julialang.org/t/how-can-i-display-single-spaced-multi-line-text-in-pluto/44483 "2020-08-08T07:49:42Z")

</div>

Dear Pluto developers and users, I know that with Pluto, “print” goes to console, and that the (best?) way to get text displayed is to have cell result as markdown. I wanted to have “versioninfo()” displayed, which prin…

---

## [Launch current version of Julia from the terminal](https://discourse.julialang.org/t/launch-current-version-of-julia-from-the-terminal/44535)

<div class="topic-metadata">

**Author:** [@onButtonUp](https://discourse.julialang.org/u/onButtonUp)\
**Replies:** 7\
**Last updated:** [August 8, 2020, 2:11am UTC](https://discourse.julialang.org/t/launch-current-version-of-julia-from-the-terminal/44535 "2020-08-08T02:11:25Z")

</div>

After installing Julia 1.5, the terminal (Mac OS) still launches v1.4.2. How can I get it to launch v1.5 ?

---

## [What's a good way to create an animation from a timestamped image sequence?](https://discourse.julialang.org/t/whats-a-good-way-to-create-an-animation-from-a-timestamped-image-sequence/44471)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 8\
**Last updated:** [August 8, 2020, 1:33am UTC](https://discourse.julialang.org/t/whats-a-good-way-to-create-an-animation-from-a-timestamped-image-sequence/44471 "2020-08-08T01:33:49Z")

</div>

I am doing an event-based simulation, that gets updated when each event happens. For simplicity’s sake, assume it’s a simple Poisson process that creates a random 100x100 matrix when each event happens. So we’ll have a s…

---

## [Diffeqpy complex ODE](https://discourse.julialang.org/t/diffeqpy-complex-ode/44530)

<div class="topic-metadata">

**Author:** [@m4hdiattar](https://discourse.julialang.org/u/m4hdiattar)\
**Replies:** 1\
**Last updated:** [August 8, 2020, 1:02am UTC](https://discourse.julialang.org/t/diffeqpy-complex-ode/44530 "2020-08-08T01:02:43Z")

</div>

I am using diffeqpy package for solving my problem which is a system of complex ODEs. problem here is that it seems like the function ODEProblem is not working on complex equations and I got the error below: can anyone…

---

## [Dataframe transform operation on multiple columns](https://discourse.julialang.org/t/dataframe-transform-operation-on-multiple-columns/44529)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 10\
**Last updated:** [August 8, 2020, 12:18am UTC](https://discourse.julialang.org/t/dataframe-transform-operation-on-multiple-columns/44529 "2020-08-08T00:18:21Z")

</div>

Hello, I am trying to use transform on multiple columns of a dataframe, that is I want apply an operation taking 2 variables as inputs, column1 and column2 and output the result. A simple example would be: df = DataF…

---

## [How to correctly manage memory during ccall?](https://discourse.julialang.org/t/how-to-correctly-manage-memory-during-ccall/44420)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 5\
**Last updated:** [August 7, 2020, 11:03pm UTC](https://discourse.julialang.org/t/how-to-correctly-manage-memory-during-ccall/44420 "2020-08-07T23:03:41Z")

</div>

Hi, I’m trying to wrap RCpp C++ code for use from Julia. The original code used R objects created from C++ to pass back arrays created in C++. I don’t understand what I have to do to correctly change the code for Julia …

---

## [Linear algebra bug?](https://discourse.julialang.org/t/linear-algebra-bug/44513)

<div class="topic-metadata">

**Author:** [@jensen](https://discourse.julialang.org/u/jensen)\
**Replies:** 4\
**Last updated:** [August 7, 2020, 9:55pm UTC](https://discourse.julialang.org/t/linear-algebra-bug/44513 "2020-08-07T21:55:29Z")

</div>

I translating some code from octave/matlab to Julia. However, the code does not work. I have isolated the problem in the enclosed octave/julia files. The octave code produces the correct result. The problem is in the ca…

---

## [Type definition works in the REPL, doesn't work in a module](https://discourse.julialang.org/t/type-definition-works-in-the-repl-doesnt-work-in-a-module/44515)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 5\
**Last updated:** [August 7, 2020, 9:54pm UTC](https://discourse.julialang.org/t/type-definition-works-in-the-repl-doesnt-work-in-a-module/44515 "2020-08-07T21:54:30Z")

</div>

I feel like I’m missing something basic here. The following code works when pasted in to the REPL: using DataStructures: MutableLinkedList module MyModule struct MapEntry{T\<:Number, M, N} IC::Array{T,M} …

---

## [Best symbolic calculus/algebra package(s) for Julia?](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451)

<div class="topic-metadata">

**Author:** [@narnold0](https://discourse.julialang.org/u/narnold0)\
**Replies:** 13\
**Last updated:** [August 7, 2020, 6:56pm UTC](https://discourse.julialang.org/t/best-symbolic-calculus-algebra-package-s-for-julia/44451 "2020-08-07T18:56:03Z")

</div>

So I’ve been trying out python lately but I learned about Julia and it seems pretty amazing so I want to switch to it. I set up juno and it’s working fine but I’ve been having trouble finding resources concerning the va…

---

## [Trying to understand allocations while creating vectors](https://discourse.julialang.org/t/trying-to-understand-allocations-while-creating-vectors/44512)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [August 7, 2020, 5:15pm UTC](https://discourse.julialang.org/t/trying-to-understand-allocations-while-creating-vectors/44512 "2020-08-07T17:15:22Z")

</div>

On my laptop it appears that creating a Vector{Float64} with \>2048 elements triggers an extra allocation julia\> @btime Vector{Float64}(undef, 2048); 379.093 ns (1 allocation: 16.13 KiB) julia\> @btime Vector{Float64}(…

---

## [Plots: reduce size of scatter plots, etc.?](https://discourse.julialang.org/t/plots-reduce-size-of-scatter-plots-etc/44445)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 9\
**Last updated:** [August 7, 2020, 4:03pm UTC](https://discourse.julialang.org/t/plots-reduce-size-of-scatter-plots-etc/44445 "2020-08-07T16:03:35Z")

</div>

I’m trying to visualize parameter uncertainty in results from the Turing package. For each parameter, there is a vector of realizations of the parameter. If I use the StatsPlots package, function density allows me to plo…

---

## [@sk\_import preprocessing: LabelEncoder is throwing the following error: PackagesNotFoundError: The following packages are missing from the target environment: - mkl](https://discourse.julialang.org/t/sk-import-preprocessing-labelencoder-is-throwing-the-following-error-packagesnotfounderror-the-following-packages-are-missing-from-the-target-environment-mkl/44507)

<div class="topic-metadata">

**Author:** [@Mrinalini\_madhusudan](https://discourse.julialang.org/u/Mrinalini_madhusudan)\
**Replies:** 0\
**Last updated:** [August 7, 2020, 4:00pm UTC](https://discourse.julialang.org/t/sk-import-preprocessing-labelencoder-is-throwing-the-following-error-packagesnotfounderror-the-following-packages-are-missing-from-the-target-environment-mkl/44507 "2020-08-07T16:00:44Z")

</div>

This error didn’t come when i compiled @sk\_import preprocessing: LabelEncoder for the first time, but throwing this error for the subsequent runs. I also face the same issue for every other library import. Eg. @sk\_imp…

---

## [Pass (to Julia) a C struct which contains a pointer to another struct](https://discourse.julialang.org/t/pass-to-julia-a-c-struct-which-contains-a-pointer-to-another-struct/44406)

<div class="topic-metadata">

**Author:** [@Vangelis](https://discourse.julialang.org/u/Vangelis)\
**Replies:** 11\
**Last updated:** [August 7, 2020, 3:51pm UTC](https://discourse.julialang.org/t/pass-to-julia-a-c-struct-which-contains-a-pointer-to-another-struct/44406 "2020-08-07T15:51:49Z")

</div>

Dear experts, assume the module below: module PointsModule struct Point x::Cdouble y::Cdouble z::Cdouble end struct Points n\_of\_points::Cint all\_points::Vector{Point} end function sum\_points(my\_points::Points):…

---

## [Why is os.walk() + regex so much slower than glob](https://discourse.julialang.org/t/why-is-os-walk-regex-so-much-slower-than-glob/43906)

<div class="topic-metadata">

**Author:** [@OffbeatNeat](https://discourse.julialang.org/u/OffbeatNeat)\
**Replies:** 2\
**Last updated:** [August 7, 2020, 3:17pm UTC](https://discourse.julialang.org/t/why-is-os-walk-regex-so-much-slower-than-glob/43906 "2020-08-07T15:17:29Z")

</div>

Hi! So myself and another coworker were both writing julia code that basically did the same thing as a specific GNU find command. For my implementation, I used a regex for the filename and walkdir to find the files, so…

---

## [Dealing with optional dependencies in v1.5?](https://discourse.julialang.org/t/dealing-with-optional-dependencies-in-v1-5/44411)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 2\
**Last updated:** [August 7, 2020, 2:08pm UTC](https://discourse.julialang.org/t/dealing-with-optional-dependencies-in-v1-5/44411 "2020-08-07T14:08:42Z")

</div>

I’ve been having an issue for a long time with Compose and its optional Cairo backend. Compose uses Requires.jl to support Cairo. This works fine unless you make a new package that uses both : module TestCompose usi…

---

## [Geographic (heat)map with pyplot()](https://discourse.julialang.org/t/geographic-heat-map-with-pyplot/41015)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 1\
**Last updated:** [August 7, 2020, 1:26pm UTC](https://discourse.julialang.org/t/geographic-heat-map-with-pyplot/41015 "2020-08-07T13:26:00Z")

</div>

I have a vector of coordinates (long, lat) and the associated vector of a given variable x. How can I generate a heat map that looks like a geographic map in which the variable x takes different shades according to its v…

---

## [Better design pattern for this type of development..?](https://discourse.julialang.org/t/better-design-pattern-for-this-type-of-development/44497)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 5\
**Last updated:** [August 7, 2020, 1:18pm UTC](https://discourse.julialang.org/t/better-design-pattern-for-this-type-of-development/44497 "2020-08-07T13:18:53Z")

</div>

I have a lot of Julia code that goes something like this: const data = DataFrame!(CSV.File("path/to/some/file.csv")) function foo(data) for row in eachrow(data) # do some stuff end return # some in…

---

## [How would I use the any function to find unique members of any arbitrary amount of dataframes?](https://discourse.julialang.org/t/how-would-i-use-the-any-function-to-find-unique-members-of-any-arbitrary-amount-of-dataframes/44213)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 4\
**Last updated:** [August 7, 2020, 12:59pm UTC](https://discourse.julialang.org/t/how-would-i-use-the-any-function-to-find-unique-members-of-any-arbitrary-amount-of-dataframes/44213 "2020-08-07T12:59:36Z")

</div>

Hi how’s it going, I’m looking to write something where I don’t have to hard code how many groups I’m searching through, and find the unique members of each group. For example: group1 = DataFrame(:member=\>\["phil","bob"…

---

## [How do I type lambda functions?](https://discourse.julialang.org/t/how-do-i-type-lambda-functions/44461)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 5\
**Last updated:** [August 7, 2020, 12:40pm UTC](https://discourse.julialang.org/t/how-do-i-type-lambda-functions/44461 "2020-08-07T12:40:02Z")

</div>

I want to do something like this: struct Foo myFunc::Function{Int,Float64} # invalid Julia end zee(a::Int, b::Float64) = a+b bar = Foo(zee)

---

## [Implement iteration of Struct](https://discourse.julialang.org/t/implement-iteration-of-struct/44459)

<div class="topic-metadata">

**Author:** [@cojua8](https://discourse.julialang.org/u/cojua8)\
**Replies:** 4\
**Last updated:** [August 7, 2020, 12:16pm UTC](https://discourse.julialang.org/t/implement-iteration-of-struct/44459 "2020-08-07T12:16:01Z")

</div>

Hi, I’m trying to implement iteration on a small struct: struct Coordinate x::Float64 y::Float64 Coordinate(x, y) = new(x, y) end So that I can unpack its members like this: x, y = Coordinate(1,1) Any he…

---

## [Share and modify struct from master in worker](https://discourse.julialang.org/t/share-and-modify-struct-from-master-in-worker/43952)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 8\
**Last updated:** [August 7, 2020, 10:41am UTC](https://discourse.julialang.org/t/share-and-modify-struct-from-master-in-worker/43952 "2020-08-07T10:41:50Z")

</div>

I am developing a GUI using CImGui.jl and want to run it in a separate process and communicate to/from the master process by modifying a struct. The struct contents could be anything: Array, Strings, file handles. I can…

---

## [Unable to create shared libraries or custom sysimages with PackageCompiler in ubuntu](https://discourse.julialang.org/t/unable-to-create-shared-libraries-or-custom-sysimages-with-packagecompiler-in-ubuntu/44128)

<div class="topic-metadata">

**Author:** [@Jorge\_Alvarado](https://discourse.julialang.org/u/Jorge_Alvarado)\
**Replies:** 1\
**Last updated:** [August 7, 2020, 10:37am UTC](https://discourse.julialang.org/t/unable-to-create-shared-libraries-or-custom-sysimages-with-packagecompiler-in-ubuntu/44128 "2020-08-07T10:37:03Z")

</div>

I’m trying to create a small app using Julia. This is the repo: I ventured into the packagecompiler.jl documentation, I tried to follow all the steps, unfortunately I get an error: $ julia --startup-file=no --output…

---

## [RNG object that provides random numbers from a pre-defined vector](https://discourse.julialang.org/t/rng-object-that-provides-random-numbers-from-a-pre-defined-vector/44424)

<div class="topic-metadata">

**Author:** [@zierenberg](https://discourse.julialang.org/u/zierenberg)\
**Replies:** 3\
**Last updated:** [August 7, 2020, 10:37am UTC](https://discourse.julialang.org/t/rng-object-that-provides-random-numbers-from-a-pre-defined-vector/44424 "2020-08-07T10:37:02Z")

</div>

Hi all, I could need some help to understand how I can implement (clean) new RNGs. I have the following in mind: Given I have a (large) set of random numbers (e.g. real random numbers from some experiment) or a sequence…

---

## [Building documentation for module](https://discourse.julialang.org/t/building-documentation-for-module/44460)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 5\
**Last updated:** [August 7, 2020, 8:41am UTC](https://discourse.julialang.org/t/building-documentation-for-module/44460 "2020-08-07T08:41:34Z")

</div>

I have implemented a small module to read JSONLines files and especially parts of a file without loading the whole file into memory. I would (eventually) like to register the package so I would like to build documentatio…

---

## [Question about HHT Pkg](https://discourse.julialang.org/t/question-about-hht-pkg/44477)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 1\
**Last updated:** [August 7, 2020, 7:47am UTC](https://discourse.julialang.org/t/question-about-hht-pkg/44477 "2020-08-07T07:47:26Z")

</div>

using EmpiricalModeDecomposition a=convert(Vector{Float64},rand(20)) s=EmpiricalModeDecomposition.EEMDSetting(2,2,2,2,2,10.0) w=EmpiricalModeDecomposition.eemd(a,s) EMD\_heping\_1MX\_V\_35kV1=EmpiricalModeDecomposition.hht(a…

---

## [MethodError: no method matching findall(::Regex, ::String)](https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 2\
**Last updated:** [August 7, 2020, 6:43am UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-findall-regex-string/44468 "2020-08-07T06:43:16Z")

</div>

Would you help me? Is there any way, how to use function findall(::Regex,::String) in Julia ver1.1.1 Thank you in advance. Best

---

## [Splatting tuples into a named tuple implicitly converts them to pairs?](https://discourse.julialang.org/t/splatting-tuples-into-a-named-tuple-implicitly-converts-them-to-pairs/44351)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 2\
**Last updated:** [August 7, 2020, 2:48am UTC](https://discourse.julialang.org/t/splatting-tuples-into-a-named-tuple-implicitly-converts-them-to-pairs/44351 "2020-08-07T02:48:36Z")

</div>

I was reading the docstring for NamedTuple and I discovered something odd. You can create a named tuple using pairs, like this: julia\> (; :a=\>1, :b=\>2) (a = 1, b = 2) Trying to do the same thing with tuples instead of …

---

## [How to get first or last n elements from SortedMultiDict?](https://discourse.julialang.org/t/how-to-get-first-or-last-n-elements-from-sortedmultidict/44469)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 6\
**Last updated:** [August 7, 2020, 4:58am UTC](https://discourse.julialang.org/t/how-to-get-first-or-last-n-elements-from-sortedmultidict/44469 "2020-08-07T04:58:29Z")

</div>

Let’s say I want to call a function on the first n elements of sorted multi-dictionary. I can only come up with this clumsy way of doing it: smdict = SortedMultiDict{Float64, Int64}(0.7=\>7, 0.1=\>1, 0.4=\>4, 0.2=\>2) i = s…

---

## [Heatmap Interpolation](https://discourse.julialang.org/t/heatmap-interpolation/44472)

<div class="topic-metadata">

**Author:** [@bobmccrory](https://discourse.julialang.org/u/bobmccrory)\
**Replies:** 0\
**Last updated:** [August 7, 2020, 2:57am UTC](https://discourse.julialang.org/t/heatmap-interpolation/44472 "2020-08-07T02:57:23Z")

</div>

I’m trying to get a smooth heatmap for showing fluid flow. When I use MatPlotLib in Python, using this code: im = plt.imshow(fluid.density, cmap=‘hot’, vmax=100, interpolation=‘bilinear’) I get a heatmap that interpol…

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

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