# General Usage

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

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

**Page:** 726

---

## [Any attempt to use Pkg turns into failure](https://discourse.julialang.org/t/any-attempt-to-use-pkg-turns-into-failure/43222)

<div class="topic-metadata">

**Author:** [@Berz\_Qwer](https://discourse.julialang.org/u/Berz_Qwer)\
**Replies:** 3\
**Last updated:** [July 17, 2020, 3:00pm UTC](https://discourse.julialang.org/t/any-attempt-to-use-pkg-turns-into-failure/43222 "2020-07-17T15:00:23Z")

</div>

ERROR: Plots=91a5bcdd-55d7-5caf-9e0b-520d859cae80 depends on Pkg=44cfe95a-1eb2-52ea-b672-e2afdf69b78f, but entry with UUID 44cfe95a-1eb2-52ea-b672-e2afdf69b78f has name Pkg-93b6d6de857dc88e665d2c64397852ab9701ba24. Stac…

---

## [Redirecting stdout to avoid banners while \`import\`ing](https://discourse.julialang.org/t/redirecting-stdout-to-avoid-banners-while-import-ing/37633)

<div class="topic-metadata">

**Author:** [@abulak](https://discourse.julialang.org/u/abulak)\
**Replies:** 12\
**Last updated:** [July 17, 2020, 6:31pm UTC](https://discourse.julialang.org/t/redirecting-stdout-to-avoid-banners-while-import-ing/37633 "2020-07-17T18:31:23Z")

</div>

I have a silly problem: We’re using a few packages that insist on printing their banners upon importing (consider this as something beyond me:). This results in a “barrage of banners” situation. I tried to redirect out…

---

## [Dependent mass matrix with RadauIIA5](https://discourse.julialang.org/t/dependent-mass-matrix-with-radauiia5/43189)

<div class="topic-metadata">

**Author:** [@Jorge\_Silva](https://discourse.julialang.org/u/Jorge_Silva)\
**Replies:** 4\
**Last updated:** [July 17, 2020, 5:28pm UTC](https://discourse.julialang.org/t/dependent-mass-matrix-with-radauiia5/43189 "2020-07-17T17:28:48Z")

</div>

When running this code Im obtaing not expect not smooth solutions. using Plots using DifferentialEquations Ta=20.0+273.15; ka=1.5207e-11\*Ta^3 - 4.…

---

## [Question about clustering visualization](https://discourse.julialang.org/t/question-about-clustering-visualization/43240)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 1\
**Last updated:** [July 17, 2020, 3:32pm UTC](https://discourse.julialang.org/t/question-about-clustering-visualization/43240 "2020-07-17T15:32:43Z")

</div>

Can anyone introduce some good Pkg for clustering visualization?(T-sne seems to have stopped updating) thank you!!!

---

## [Calling a function with variable numbers of parameters using an array](https://discourse.julialang.org/t/calling-a-function-with-variable-numbers-of-parameters-using-an-array/43235)

<div class="topic-metadata">

**Author:** [@grahamstark](https://discourse.julialang.org/u/grahamstark)\
**Replies:** 3\
**Last updated:** [July 17, 2020, 1:53pm UTC](https://discourse.julialang.org/t/calling-a-function-with-variable-numbers-of-parameters-using-an-array/43235 "2020-07-17T13:53:10Z")

</div>

There is a function I want to call that accepts a variable number of parameters of a given type. If I have an array of objects of that type (or some other collection), is there some trick I can use to just pass the colle…

---

## [Call Intel MKL as external library](https://discourse.julialang.org/t/call-intel-mkl-as-external-library/2097)

<div class="topic-metadata">

**Author:** [@Tecnezio](https://discourse.julialang.org/u/Tecnezio)\
**Replies:** 6\
**Last updated:** [July 17, 2020, 1:52pm UTC](https://discourse.julialang.org/t/call-intel-mkl-as-external-library/2097 "2020-07-17T13:52:42Z")

</div>

I wrote a script to test a call to Intel MKL a external library but it doesn’t work. The concept: Solve a linear system using MKL “dgetrs” (Documentation Library) # Test MKL solve linear systems N = 10; A = rand(N,N)…

---

## [How do I not skip missing values when using stack / unstack for pivot tables](https://discourse.julialang.org/t/how-do-i-not-skip-missing-values-when-using-stack-unstack-for-pivot-tables/43238)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 2\
**Last updated:** [July 17, 2020, 1:26pm UTC](https://discourse.julialang.org/t/how-do-i-not-skip-missing-values-when-using-stack-unstack-for-pivot-tables/43238 "2020-07-17T13:26:22Z")

</div>

Hi how’s it going, Here’s an example to better explain what I mean: df = DataFrame(:user=\>\["bob","bob","phil","phil"\],:count=\>\["one","two","two",missing\]) var1 = :user var2 = :count long\_df = by(df,\[var1,var2\],var2=\>l…

---

## [Using push!() on an array with 'nothing' as its only value results in error](https://discourse.julialang.org/t/using-push-on-an-array-with-nothing-as-its-only-value-results-in-error/43188)

<div class="topic-metadata">

**Author:** [@JaydevSR](https://discourse.julialang.org/u/JaydevSR)\
**Replies:** 10\
**Last updated:** [July 17, 2020, 12:56pm UTC](https://discourse.julialang.org/t/using-push-on-an-array-with-nothing-as-its-only-value-results-in-error/43188 "2020-07-17T12:56:10Z")

</div>

I was trying to implement a stack using an array for which I had to create a single value array \[nothing\]. I needed nothing because my code included peeking the array. But when I tried to push an integer value into the a…

---

## [Qr of custom number type works but svd fails to find a method](https://discourse.julialang.org/t/qr-of-custom-number-type-works-but-svd-fails-to-find-a-method/43226)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 2\
**Last updated:** [July 17, 2020, 12:08pm UTC](https://discourse.julialang.org/t/qr-of-custom-number-type-works-but-svd-fails-to-find-a-method/43226 "2020-07-17T12:08:06Z")

</div>

Hi, I’ve been playing around with implementing MyQuaternion type to demonstrate versatility of Julia’s type system to newcomers. I managed to get QR to work, but svd fails for some reason. Here is my implementation: us…

---

## [Passing symbol values using \`@everywhere\`?](https://discourse.julialang.org/t/passing-symbol-values-using-everywhere/43178)

<div class="topic-metadata">

**Author:** [@haberdashPI](https://discourse.julialang.org/u/haberdashPI)\
**Replies:** 3\
**Last updated:** [July 16, 2020, 9:05pm UTC](https://discourse.julialang.org/t/passing-symbol-values-using-everywhere/43178 "2020-07-16T21:05:19Z")

</div>

This seems like a bug: julia\> using Distributed; addprocs() julia\> classifier = :logistic\_l1 julia\> @everywhere classifier = $classifier ERROR: On worker 2: UndefVarError: logistic\_l1 not defined top-level scope at none…

---

## [Help with ForwardDiff2](https://discourse.julialang.org/t/help-with-forwarddiff2/38384)

<div class="topic-metadata">

**Author:** [@francesco.alemanno](https://discourse.julialang.org/u/francesco.alemanno)\
**Replies:** 1\
**Last updated:** [July 17, 2020, 7:57am UTC](https://discourse.julialang.org/t/help-with-forwarddiff2/38384 "2020-07-17T07:57:28Z")

</div>

I cant’s seem to make this kind of code work with ForwardDiff2 function gaussian(f,N) a=-8.38149 # exp(-x^2/2)/sqrt(2π) == eps(1.0) b=8.38149 dx=(b-a)/(N) Δ=(b-a)/(2N) x=a+Δ I=(exp(-x\*x/2).\*f(x)…

---

## [Memory allocations when converting from NamedTuples to DataFrame](https://discourse.julialang.org/t/memory-allocations-when-converting-from-namedtuples-to-dataframe/43171)

<div class="topic-metadata">

**Author:** [@miromarszal](https://discourse.julialang.org/u/miromarszal)\
**Replies:** 4\
**Last updated:** [July 17, 2020, 7:37am UTC](https://discourse.julialang.org/t/memory-allocations-when-converting-from-namedtuples-to-dataframe/43171 "2020-07-17T07:37:44Z")

</div>

I have been struggling with this since a while. When I’m trying to convert an Array of NamedTuple to DataFrame, I’m seeing excessive memory allocations. Consider the following stripped-down example: using DataFrames usi…

---

## [Best practice for packaging python package in a Julia package](https://discourse.julialang.org/t/best-practice-for-packaging-python-package-in-a-julia-package/43217)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 0\
**Last updated:** [July 17, 2020, 7:20am UTC](https://discourse.julialang.org/t/best-practice-for-packaging-python-package-in-a-julia-package/43217 "2020-07-17T07:20:58Z")

</div>

I saw this https://github.com/JuliaML/OpenAIGym.jl/issues/42 So that got me thinking, what’s the best to package Python packages for Julia? What if these PYthon packages contain binaries? If there a way to use BinaryBui…

---

## [Simple keyboard interaction with Makie visualization](https://discourse.julialang.org/t/simple-keyboard-interaction-with-makie-visualization/43215)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 0\
**Last updated:** [July 17, 2020, 6:48am UTC](https://discourse.julialang.org/t/simple-keyboard-interaction-with-makie-visualization/43215 "2020-07-17T06:48:59Z")

</div>

I want to visualize 2D/3D output of some function with different arguments depending on simple keyboard input: a key pressed produces new output for visualization. Here is a simple example: using Makie let npoints = …

---

## [Read array of strings into Dictionary of DataFrames](https://discourse.julialang.org/t/read-array-of-strings-into-dictionary-of-dataframes/43202)

<div class="topic-metadata">

**Author:** [@evad](https://discourse.julialang.org/u/evad)\
**Replies:** 1\
**Last updated:** [July 17, 2020, 6:19am UTC](https://discourse.julialang.org/t/read-array-of-strings-into-dictionary-of-dataframes/43202 "2020-07-17T06:19:19Z")

</div>

Hi, I have an array of strings where each string is a stream of multiple tables. And the final step of my function is to create and return a dictionary: function readTables(str) nStrs = split(str,"\\r\\n%T\\t") fHea…

---

## [Tuples, iterators, splats, and type stability](https://discourse.julialang.org/t/tuples-iterators-splats-and-type-stability/42849)

<div class="topic-metadata">

**Author:** [@mhauru](https://discourse.julialang.org/u/mhauru)\
**Replies:** 10\
**Last updated:** [July 17, 2020, 3:05am UTC](https://discourse.julialang.org/t/tuples-iterators-splats-and-type-stability/42849 "2020-07-17T03:05:03Z")

</div>

I’m trying understand type stability of functions like f(t::Tuple) = tuple(t...) g(t::Tuple) = tuple((identity(l) for l in t)...) identity here is meant to be a place-holder for any type stable function. Of the two, f …

---

## [Dependencies of src files inside a package](https://discourse.julialang.org/t/dependencies-of-src-files-inside-a-package/43144)

<div class="topic-metadata">

**Author:** [@oheil](https://discourse.julialang.org/u/oheil)\
**Replies:** 10\
**Last updated:** [July 17, 2020, 1:44am UTC](https://discourse.julialang.org/t/dependencies-of-src-files-inside-a-package/43144 "2020-07-17T01:44:46Z")

</div>

I am struggling with dependencies of several files inside a project (MWE package M). I have illustrated the current structure (of a MWE), which reflects the natural separation of different parts of the real project: F…

---

## [Importing packages by directory](https://discourse.julialang.org/t/importing-packages-by-directory/43140)

<div class="topic-metadata">

**Author:** [@MA\_Laforge](https://discourse.julialang.org/u/MA_Laforge)\
**Replies:** 7\
**Last updated:** [July 17, 2020, 1:35am UTC](https://discourse.julialang.org/t/importing-packages-by-directory/43140 "2020-07-17T01:35:31Z")

</div>

Question Is there a way to perform a “proper” import using a local path as an argument?: import CMDimData import\_by\_path joinpath("/path/to/CMDimData/subpkgs/EasyPlotMPL") Otherwise, does someone have a better suggesti…

---

## [Calling Julia from Python on thread](https://discourse.julialang.org/t/calling-julia-from-python-on-thread/43187)

<div class="topic-metadata">

**Author:** [@james\_p\_d](https://discourse.julialang.org/u/james_p_d)\
**Replies:** 2\
**Last updated:** [July 17, 2020, 1:13am UTC](https://discourse.julialang.org/t/calling-julia-from-python-on-thread/43187 "2020-07-17T01:13:39Z")

</div>

I’ve been playing around with calling Julia functions from Python which has all worked fine until I try and call from a thread. To illustrate, here is a short example: Julia code: function add(x, y) return x + y en…

---

## [Is pmap type stable?](https://discourse.julialang.org/t/is-pmap-type-stable/25450)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [July 16, 2020, 9:57pm UTC](https://discourse.julialang.org/t/is-pmap-type-stable/25450 "2020-07-16T21:57:03Z")

</div>

Using @code\_warntype on pmap, this is reported as type unstable, is this true ? Is there a way to make it type stable ? julia\> using Distributed, BenchmarkTools julia\> a = rand(1:35,100) # Int64\[100\] julia\> addprocs(3)…

---

## [Confusion about optimizations in @code\_typed](https://discourse.julialang.org/t/confusion-about-optimizations-in-code-typed/43197)

<div class="topic-metadata">

**Author:** [@xitology](https://discourse.julialang.org/u/xitology)\
**Replies:** 0\
**Last updated:** [July 16, 2020, 8:52pm UTC](https://discourse.julialang.org/t/confusion-about-optimizations-in-code-typed/43197 "2020-07-16T20:52:39Z")

</div>

I’m trying to learn how to optimize Julia code, and at some point I discovered I don’t understand the behavior of @code\_typed. I defined a simple recursive Fibonacci function: julia\> fib(n) = n \<= 1 ? n : fib(n-1) + fi…

---

## [What does \[\] mean in this case?](https://discourse.julialang.org/t/what-does-mean-in-this-case/43175)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 14\
**Last updated:** [July 16, 2020, 4:34pm UTC](https://discourse.julialang.org/t/what-does-mean-in-this-case/43175 "2020-07-16T16:34:09Z")

</div>

I’m trying to figure out a functionality of Makie.jl, which I can’t find in documentation. In the process, I noticed a syntax I don’t understand: julia\> s = Scene() julia\> fieldnames(Scene) (:parent, :events, :px\_area,…

---

## [Issue with Array of user-defined type](https://discourse.julialang.org/t/issue-with-array-of-user-defined-type/43166)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 4\
**Last updated:** [July 16, 2020, 3:50pm UTC](https://discourse.julialang.org/t/issue-with-array-of-user-defined-type/43166 "2020-07-16T15:50:05Z")

</div>

Hello, I would like to create a parametric struct Basis that holds a vector of a user-defined type ParamFcn. I define the functions getindex and setindex! for the struct Basis but the command @warn\_type that the the typ…

---

## [any(f::Function, a::AbstractArray; dims)](https://discourse.julialang.org/t/any-f-function-a-abstractarray-dims/42607)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 9\
**Last updated:** [July 16, 2020, 3:18pm UTC](https://discourse.julialang.org/t/any-f-function-a-abstractarray-dims/42607 "2020-07-16T15:18:10Z")

</div>

is defined (reducedim.jl:729, Julia 1.5.0-rc1.0), but not documented. Also, its behaviour is slightly different from any(a;dims), For instance, any(\[1 2\].\>0,dims=2) gives a BitArray, while any(i-\>i\>0,\[1 2\],dims=2) give…

---

## [Pyjulia - accessing data in a Julia Dataframe that was called from Python](https://discourse.julialang.org/t/pyjulia-accessing-data-in-a-julia-dataframe-that-was-called-from-python/32082)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 5\
**Last updated:** [July 16, 2020, 2:20pm UTC](https://discourse.julialang.org/t/pyjulia-accessing-data-in-a-julia-dataframe-that-was-called-from-python/32082 "2020-07-16T14:20:26Z")

</div>

I had a bunch of help from @stevengj to solve this problem of calling Julia from python. So that was great. I can now write a function in Julia that generates a Dataframe and call that back into python. But I was not sur…

---

## [ArgumentError: array must be non-empty while calling Serialization.deserialize(f) function](https://discourse.julialang.org/t/argumenterror-array-must-be-non-empty-while-calling-serialization-deserialize-f-function/28508)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [July 16, 2020, 2:17pm UTC](https://discourse.julialang.org/t/argumenterror-array-must-be-non-empty-while-calling-serialization-deserialize-f-function/28508 "2020-07-16T14:17:30Z")

</div>

The following is the code: if use\_cache && isfile(cachefile) f = open(cachefile, "r") res = Serialization.deserialize(f) close(f); end Then, I got an error, saying that “ArgumentError: array must be non-…

---

## [Debugging forced package downgrade](https://discourse.julialang.org/t/debugging-forced-package-downgrade/43172)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 2\
**Last updated:** [July 16, 2020, 11:41am UTC](https://discourse.julialang.org/t/debugging-forced-package-downgrade/43172 "2020-07-16T11:41:54Z")

</div>

This happens occasionally: I have an env with 10-20 deps, one of the package’s latest version is 0.x.4 and I currently have 0.x.1; doing up doesn’t change anything. Forcing with add thePackage@0.x.4 leads to ├─possible…

---

## [Type checking in Dictionaries](https://discourse.julialang.org/t/type-checking-in-dictionaries/43156)

<div class="topic-metadata">

**Author:** [@hdavid16](https://discourse.julialang.org/u/hdavid16)\
**Replies:** 7\
**Last updated:** [July 16, 2020, 10:43am UTC](https://discourse.julialang.org/t/type-checking-in-dictionaries/43156 "2020-07-16T10:43:31Z")

</div>

The Julia style guide says, For example, don’t declare an argument to be of type Int or Int32 if it really could be any integer, expressed with the abstract type Integer (Numbers · The Julia Language) However,…

---

## [Capture part of return type](https://discourse.julialang.org/t/capture-part-of-return-type/43139)

<div class="topic-metadata">

**Author:** [@grahamas](https://discourse.julialang.org/u/grahamas)\
**Replies:** 4\
**Last updated:** [July 16, 2020, 10:08am UTC](https://discourse.julialang.org/t/capture-part-of-return-type/43139 "2020-07-16T10:08:41Z")

</div>

Is there a way to capture the type of a return in a variable (specifically a parameter of the variable type, but baby steps) function f() A::AbstractArray{T} where T = \[1.0 2.0\] return T end Of course I can pre…

---

## [Package compatibility with language versions](https://discourse.julialang.org/t/package-compatibility-with-language-versions/43108)

<div class="topic-metadata">

**Author:** [@pengwyn](https://discourse.julialang.org/u/pengwyn)\
**Replies:** 7\
**Last updated:** [July 16, 2020, 9:05am UTC](https://discourse.julialang.org/t/package-compatibility-with-language-versions/43108 "2020-07-16T09:05:24Z")

</div>

I’m looking for opinions about what is the best practice in dealing with differences in Julia language versions, e.g. between v1.0 and v1.4 with packages. Should packages stick with v1.0 compatibility as much as possible…

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

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