# General Usage

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

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

**Page:** 445

---

## [Question about Animation?](https://discourse.julialang.org/t/question-about-animation/81795)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 5\
**Last updated:** [May 27, 2022, 5:37pm UTC](https://discourse.julialang.org/t/question-about-animation/81795 "2022-05-27T17:37:49Z")

</div>

Dear all, I have set the color of bar to red ,but I always get the color of grey. What’s wrong with this problem? using DataFrames using CSV using Plots using PlotThemes df = DataFrame(CSV.File("gdp.csv", header=true)…

---

## [My ImmutableDict Changes Its Values](https://discourse.julialang.org/t/my-immutabledict-changes-its-values/81793)

<div class="topic-metadata">

**Author:** [@dburch](https://discourse.julialang.org/u/dburch)\
**Replies:** 1\
**Last updated:** [May 27, 2022, 3:39pm UTC](https://discourse.julialang.org/t/my-immutabledict-changes-its-values/81793 "2022-05-27T15:39:23Z")

</div>

Is this correct? When I change some of the values in the last variable used to assign a key-val pair to the ImmutableDict the values in the immutable dictionary are changing. Is this a bug or correct behavior? Is so, the…

---

## [Pardiso library was not loaded?](https://discourse.julialang.org/t/pardiso-library-was-not-loaded/81392)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 8\
**Last updated:** [May 27, 2022, 1:33pm UTC](https://discourse.julialang.org/t/pardiso-library-was-not-loaded/81392 "2022-05-27T13:33:14Z")

</div>

I have installed MKL, MKLSparse, Pardiso. However, when I write PardisoSolver(), it gives error. I did not know how to install a working PARDISO library. Can you please guide me? \>\> \] status MKL v0.5.0 MKLSparse v1.1.0…

---

## [Can't add package from git - authentication failure](https://discourse.julialang.org/t/cant-add-package-from-git-authentication-failure/78078)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 11\
**Last updated:** [May 27, 2022, 1:32pm UTC](https://discourse.julialang.org/t/cant-add-package-from-git-authentication-failure/78078 "2022-05-27T13:32:32Z")

</div>

Hi. I am having trouble doing something which I have done easily in the past. I am trying to add a package from git (@v1.7) pkg\> add https://github.com/msimms/LibIsolationForest.jl.git Cloning git-repo \`https://g…

---

## [Is there a way to precondition eigensolver?](https://discourse.julialang.org/t/is-there-a-way-to-precondition-eigensolver/20790)

<div class="topic-metadata">

**Author:** [@Janis\_Erdmanis](https://discourse.julialang.org/u/Janis_Erdmanis)\
**Replies:** 9\
**Last updated:** [May 27, 2022, 9:46am UTC](https://discourse.julialang.org/t/is-there-a-way-to-precondition-eigensolver/20790 "2022-05-27T09:46:36Z")

</div>

Hello everyone. I am solving a nonlinear matrix equation which can be solved be solved iteratively. A single iteration contains construction of a matrix H, its diagonalization and solution of a nonlinear equation for ope…

---

## [Typing declaring Real numbers and using Vectors as default arguments](https://discourse.julialang.org/t/typing-declaring-real-numbers-and-using-vectors-as-default-arguments/81768)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 5\
**Last updated:** [May 27, 2022, 9:34am UTC](https://discourse.julialang.org/t/typing-declaring-real-numbers-and-using-vectors-as-default-arguments/81768 "2022-05-27T09:34:47Z")

</div>

In Python I can make a method from typing import Optional, List from numbers import Real def mul(a, m:Optional\[List\[Real\]\]=None): m = \[1,2\] if m is None else m return a\*m\[0\], a\*m\[1\] Which allows \>\>\> mul(2) (2,…

---

## [Converting Pandas Dataframe returned from PyCall to Julia DataFrame](https://discourse.julialang.org/t/converting-pandas-dataframe-returned-from-pycall-to-julia-dataframe/43001)

<div class="topic-metadata">

**Author:** [@clibassi](https://discourse.julialang.org/u/clibassi)\
**Replies:** 18\
**Last updated:** [May 27, 2022, 6:43am UTC](https://discourse.julialang.org/t/converting-pandas-dataframe-returned-from-pycall-to-julia-dataframe/43001 "2022-05-27T06:43:37Z")

</div>

I’ve been trying to pull some baseball data into a dataframe and there’s a very nice Python package called pybaseball for conveniently doing this. So I’ve been playing with using PyCall to pull this data in - but am runn…

---

## [Any plan for functionality like Pandas loc?](https://discourse.julialang.org/t/any-plan-for-functionality-like-pandas-loc/81134)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 15\
**Last updated:** [May 27, 2022, 4:09am UTC](https://discourse.julialang.org/t/any-plan-for-functionality-like-pandas-loc/81134 "2022-05-27T04:09:52Z")

</div>

A cool feature of Pandas is the ability to set an index on a table. Thereafter you just specify table name and index value you want to use. Combined with Julia tools like @rtransform a DataFrame cell could be specifie…

---

## [Question about precompile](https://discourse.julialang.org/t/question-about-precompile/81756)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 3\
**Last updated:** [May 27, 2022, 3:35am UTC](https://discourse.julialang.org/t/question-about-precompile/81756 "2022-05-27T03:35:26Z")

</div>

Dear all, Why it always say “2 skipped during auto due to previous errors”. How to find which packages get error? (576 already precompiled, 2 skipped during auto due to previous errors)

---

## [VideoIO: avformat\_open\_input error code -5](https://discourse.julialang.org/t/videoio-avformat-open-input-error-code-5/81758)

<div class="topic-metadata">

**Author:** [@YANTAN520](https://discourse.julialang.org/u/YANTAN520)\
**Replies:** 0\
**Last updated:** [May 27, 2022, 3:14am UTC](https://discourse.julialang.org/t/videoio-avformat-open-input-error-code-5/81758 "2022-05-27T03:14:36Z")

</div>

When I run the following code, the following error appears. julia\>t = VideoIO.get\_camera\_devices(ffmpeg, "dshow", "dummy") julia\>VideoIO.opencamera(t\[1\]) ERROR: Could not open USB2.0 HD UVC WebCam. avformat\_open\_input e…

---

## [Computed goto (or labels as values) in Julia?](https://discourse.julialang.org/t/computed-goto-or-labels-as-values-in-julia/5013)

<div class="topic-metadata">

**Author:** [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Replies:** 9\
**Last updated:** [May 27, 2022, 2:54am UTC](https://discourse.julialang.org/t/computed-goto-or-labels-as-values-in-julia/5013 "2022-05-27T02:54:07Z")

</div>

Hi, I’m now interested in improving the performance of Julia code that emulates a finite state machine. It reads input data byte by byte and branches based on it. A branch looks like this: byte = data\[p+=1\] if byte in …

---

## [How to perform this summation in Julia](https://discourse.julialang.org/t/how-to-perform-this-summation-in-julia/81746)

<div class="topic-metadata">

**Author:** [@Leticia-maria](https://discourse.julialang.org/u/Leticia-maria)\
**Replies:** 2\
**Last updated:** [May 27, 2022, 1:34am UTC](https://discourse.julialang.org/t/how-to-perform-this-summation-in-julia/81746 "2022-05-27T01:34:53Z")

</div>

Kint = b\*((2\*(lB+mB+nB))+3)\*Sxyz(RA, RB, a, b, lA, lB, mA, mB, nA, nB) #print("$Kint \\n") Kint -= (2\*(b^2))\*Sxyz(RA, RB, a, b, lA, lB+2, mA, mB, nA, nB) Kint -= (2\*(b^2))\*Sxyz(RA, RB, a, b, lA, lB, mA, …

---

## [Using the Pkg REPL mode directly from the terminal](https://discourse.julialang.org/t/using-the-pkg-repl-mode-directly-from-the-terminal/81752)

<div class="topic-metadata">

**Author:** [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Replies:** 2\
**Last updated:** [May 27, 2022, 12:42am UTC](https://discourse.julialang.org/t/using-the-pkg-repl-mode-directly-from-the-terminal/81752 "2022-05-27T00:42:52Z")

</div>

I often need to start julia, enter the Pkg REPL to add and remove packages and then exit. I’m a lazy person, so is often too much work for me to do: julia --project julia\> \] pkg\> add Foo Bar pkg\> rm SomePkg julia\> exit(…

---

## [Question about RCall](https://discourse.julialang.org/t/question-about-rcall/81744)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 1\
**Last updated:** [May 27, 2022, 12:18am UTC](https://discourse.julialang.org/t/question-about-rcall/81744 "2022-05-27T00:18:32Z")

</div>

Dear all, When I use RCall, it always gets an error. julia\> using RCall \[ Info: Precompiling RCall \[6f49c342-dc21-5d91-9882-a32aef131414\] WARNING: Method definition Type##kw(Any, Type{Base.MPFR.BigFloat}, Base.Irratio…

---

## [Julia can't solve sparse linear system, MATLAB can](https://discourse.julialang.org/t/julia-cant-solve-sparse-linear-system-matlab-can/81692)

<div class="topic-metadata">

**Author:** [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Replies:** 5\
**Last updated:** [May 26, 2022, 10:12pm UTC](https://discourse.julialang.org/t/julia-cant-solve-sparse-linear-system-matlab-can/81692 "2022-05-26T22:12:46Z")

</div>

I am trying to solve a sparse linear system, but Julia 1.7.2 crashes (I believe it’s an OutOfMemoryError()): infil\> size(A) (2938746, 6906) infil\> nnz(A) 17591409 infil\> nnz(A)/prod(size(A)) 0.0008667862253365853 inf…

---

## [Question about PyPlot](https://discourse.julialang.org/t/question-about-pyplot/81738)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 14\
**Last updated:** [May 26, 2022, 9:08pm UTC](https://discourse.julialang.org/t/question-about-pyplot/81738 "2022-05-26T21:08:31Z")

</div>

Dear all, When I use PyPlot, It always gets an error. julia\> using PyPlot julia\> x = 1:2:100 1:2:99 julia\> y = 2x; julia\> plot(x, y) ERROR: ArgumentError: hasproperty of NULL PyObject Stacktrace: \[1\] pyhasproperty(…

---

## [How to simplify this code?](https://discourse.julialang.org/t/how-to-simplify-this-code/81734)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [May 26, 2022, 6:48pm UTC](https://discourse.julialang.org/t/how-to-simplify-this-code/81734 "2022-05-26T18:48:37Z")

</div>

I have the following type: mutable struct JSButtonState btn1::Observable{Bool} btn2::Observable{Bool} btn3::Observable{Bool} btn4::Observable{Bool} btn5::Observable{Bool} btn6::Observable{Bool} …

---

## [Conditional left join 2 dataframes when none of the columns are common](https://discourse.julialang.org/t/conditional-left-join-2-dataframes-when-none-of-the-columns-are-common/81401)

<div class="topic-metadata">

**Author:** [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Replies:** 26\
**Last updated:** [May 26, 2022, 6:28pm UTC](https://discourse.julialang.org/t/conditional-left-join-2-dataframes-when-none-of-the-columns-are-common/81401 "2022-05-26T18:28:31Z")

</div>

df1 = DataFrame(id = \[1,101,1001\], b = \[1,2,3\]) df2 = DataFrame(id1 = \[0, 95 \], id2 = \[50, 150 \], c = \[2,3\]) I want to conditionally left join df1 and df2 such that id1 \< id \< id2 and all the rows in df1 appear in t…

---

## [How to obtain numerical values of observed variables after structural simplification?](https://discourse.julialang.org/t/how-to-obtain-numerical-values-of-observed-variables-after-structural-simplification/81639)

<div class="topic-metadata">

**Author:** [@Vinicius\_Viena](https://discourse.julialang.org/u/Vinicius_Viena)\
**Replies:** 7\
**Last updated:** [May 26, 2022, 4:31pm UTC](https://discourse.julialang.org/t/how-to-obtain-numerical-values-of-observed-variables-after-structural-simplification/81639 "2022-05-26T16:31:12Z")

</div>

Hi there. I am quite new to Julia and sorry if this question is too silly, but here it goes. I have used the modelingtoolkitize function to convert my discretized PDE to symbolic form and then used the strucutural\_simpl…

---

## [How to add methods to a function](https://discourse.julialang.org/t/how-to-add-methods-to-a-function/81730)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 2\
**Last updated:** [May 26, 2022, 4:14pm UTC](https://discourse.julialang.org/t/how-to-add-methods-to-a-function/81730 "2022-05-26T16:14:27Z")

</div>

Suppose it has the task of writing a function that splits a given string at the points where there is a character change from one from to another to set. To delimit the context, suppose that the from and the to can be d…

---

## [Is Julia comprehension not a function call?](https://discourse.julialang.org/t/is-julia-comprehension-not-a-function-call/81541)

<div class="topic-metadata">

**Author:** [@juliafriend](https://discourse.julialang.org/u/juliafriend)\
**Replies:** 5\
**Last updated:** [May 26, 2022, 4:08pm UTC](https://discourse.julialang.org/t/is-julia-comprehension-not-a-function-call/81541 "2022-05-26T16:08:33Z")

</div>

If I parse a list comprehension as such: The head isn’t a Symbol call but literally a comprehension. Is call for all non-built-in functions? The first Arg for comprehension Expr isn’t a Symbol but an expression.…

---

## [Extreme compute slowness after using PLuto/Franklin?](https://discourse.julialang.org/t/extreme-compute-slowness-after-using-pluto-franklin/64542)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 9\
**Last updated:** [May 26, 2022, 4:06pm UTC](https://discourse.julialang.org/t/extreme-compute-slowness-after-using-pluto-franklin/64542 "2022-05-26T16:06:18Z")

</div>

Hi, I’m hesitating to make this post because I know how vague it is but the fact is that this already happened to me 6 times. After using Pluto, and happened also once with Franklin, my computer becomes extremely slow.…

---

## [How do I structure this correctly in my package?](https://discourse.julialang.org/t/how-do-i-structure-this-correctly-in-my-package/81726)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 5\
**Last updated:** [May 26, 2022, 4:05pm UTC](https://discourse.julialang.org/t/how-do-i-structure-this-correctly-in-my-package/81726 "2022-05-26T16:05:49Z")

</div>

Hello! I have made a small package here: In this package I have a folder structure such as: - src - geometry.jl - main.jl - main\_package.jl - math\_vectors.jl In which I try to split …

---

## [Something I like about Julia that I dont have with other langs](https://discourse.julialang.org/t/something-i-like-about-julia-that-i-dont-have-with-other-langs/81727)

<div class="topic-metadata">

**Author:** [@kodintent](https://discourse.julialang.org/u/kodintent)\
**Replies:** 0\
**Last updated:** [May 26, 2022, 3:28pm UTC](https://discourse.julialang.org/t/something-i-like-about-julia-that-i-dont-have-with-other-langs/81727 "2022-05-26T15:28:12Z")

</div>

Hi. Ive settled into using Julia for my general scripting needs. And i realized that theres something that makes it really nice for me to use. I understand all the code i use. With other languages, i quickly encountere…

---

## [Including files within a single module](https://discourse.julialang.org/t/including-files-within-a-single-module/81729)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 1\
**Last updated:** [May 26, 2022, 3:53pm UTC](https://discourse.julialang.org/t/including-files-within-a-single-module/81729 "2022-05-26T15:53:36Z")

</div>

I’m wondering if there are any general views on the cleanest way to combine files within a module. I have at present three types: Parent, Child1 and Child2. Parent is a synonym for AbstractArray{Complex}, and Child1 and C…

---

## [Reflection API for Union types](https://discourse.julialang.org/t/reflection-api-for-union-types/81612)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 7\
**Last updated:** [May 26, 2022, 2:55pm UTC](https://discourse.julialang.org/t/reflection-api-for-union-types/81612 "2022-05-26T14:55:32Z")

</div>

Are there any methods to inspect Union types? Ex: julia\> y::Union{Number,Nothing} = nothing julia\> typeof(y) Nothing 1/ how to find out the fact that y is a Union? 2/ how to get the types supported by the Union (Num…

---

## [Why can't I use any Unicode character in field name?](https://discourse.julialang.org/t/why-cant-i-use-any-unicode-character-in-field-name/81715)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 8\
**Last updated:** [May 26, 2022, 2:34pm UTC](https://discourse.julialang.org/t/why-cant-i-use-any-unicode-character-in-field-name/81715 "2022-05-26T14:34:41Z")

</div>

Hello! I am just trying this: struct Vec{Ti \<: Number, Tj \<: Number, Tk \<: Number} ₁::Ti ₂::Tj ₃::Tk end And it does not work for these unicode characters, but works for something like “\\bb…

---

## [Define coupled ODE solution as differentiable](https://discourse.julialang.org/t/define-coupled-ode-solution-as-differentiable/81708)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 2\
**Last updated:** [May 26, 2022, 1:38pm UTC](https://discourse.julialang.org/t/define-coupled-ode-solution-as-differentiable/81708 "2022-05-26T13:38:12Z")

</div>

I have a variable A defined by an ODE, and I want to treat the solution as an explicit differentiable function of time so I can tie it in with some other code. For example m\*Ä+k\*A = f(A,t) where m,k are the mass and …

---

## [For-loop over two arrays, sequentially](https://discourse.julialang.org/t/for-loop-over-two-arrays-sequentially/81699)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 3\
**Last updated:** [May 26, 2022, 9:18am UTC](https://discourse.julialang.org/t/for-loop-over-two-arrays-sequentially/81699 "2022-05-26T09:18:55Z")

</div>

I want to write code like this: for i in vcat(vector1, vector2) do\_something(i) end But I want to avoid the allocation of a new array in vcat. What’s a good way to do this?

---

## [Convert string into Cmd object](https://discourse.julialang.org/t/convert-string-into-cmd-object/81691)

<div class="topic-metadata">

**Author:** [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Replies:** 2\
**Last updated:** [May 26, 2022, 1:48am UTC](https://discourse.julialang.org/t/convert-string-into-cmd-object/81691 "2022-05-26T01:48:04Z")

</div>

How can i convert a string like "command arg1 arg2 --opt1=value --flag" into a Cmd object and run that command?

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

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