# General Usage

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

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

**Page:** 665

---

## [Migrating simple Poisson/Gamma model from Pymc3](https://discourse.julialang.org/t/migrating-simple-poisson-gamma-model-from-pymc3/52243)

<div class="topic-metadata">

**Author:** [@Lucca](https://discourse.julialang.org/u/Lucca)\
**Replies:** 3\
**Last updated:** [December 22, 2020, 8:07pm UTC](https://discourse.julialang.org/t/migrating-simple-poisson-gamma-model-from-pymc3/52243 "2020-12-22T20:07:33Z")

</div>

Hello! Following this Pymc3 notebook, I have been trying to migrate some of the models to Turing. The Estimating a rate from Poisson data: an idealized example example is a simple bayesian model with a Gamma prior for …

---

## [Arange in Julia](https://discourse.julialang.org/t/arange-in-julia/52239)

<div class="topic-metadata">

**Author:** [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)\
**Replies:** 5\
**Last updated:** [December 22, 2020, 7:39pm UTC](https://discourse.julialang.org/t/arange-in-julia/52239 "2020-12-22T19:39:48Z")

</div>

What function is used as arange in Julia ? For example, if I want to manage the frequency of xticks in my plots. In Python it works like:xticks(arange(0, length(l\_ticks)+1, 1)). Thanks in advance!

---

## [Array concatenation results in type inconsistency](https://discourse.julialang.org/t/array-concatenation-results-in-type-inconsistency/52237)

<div class="topic-metadata">

**Author:** [@a-ill](https://discourse.julialang.org/u/a-ill)\
**Replies:** 8\
**Last updated:** [December 22, 2020, 7:24pm UTC](https://discourse.julialang.org/t/array-concatenation-results-in-type-inconsistency/52237 "2020-12-22T19:24:10Z")

</div>

Here is an example. function test\_func() array1 = rand(Float64,10,10) array2 = rand(Float64,10,10) out = cat(array1,array2,dims=1) return out end @code\_warntype test\_func() Variables #self#::Core.Comp…

---

## [Example of CDDLib usage: H-representation and V-representation](https://discourse.julialang.org/t/example-of-cddlib-usage-h-representation-and-v-representation/51980)

<div class="topic-metadata">

**Author:** [@stla](https://discourse.julialang.org/u/stla)\
**Replies:** 2\
**Last updated:** [December 22, 2020, 6:15pm UTC](https://discourse.julialang.org/t/example-of-cddlib-usage-h-representation-and-v-representation/51980 "2020-12-22T18:15:14Z")

</div>

Hello, I’m trying to use CDDLib but I’m lost. Given a set of inequalities represented as a matrix and a vector, how to get the H-representation of the corresponding polyhedron? Then, how to get its V-representation, an…

---

## [Trying to use Dash DataTable](https://discourse.julialang.org/t/trying-to-use-dash-datatable/51519)

<div class="topic-metadata">

**Author:** [@PaulBog69](https://discourse.julialang.org/u/PaulBog69)\
**Replies:** 6\
**Last updated:** [December 22, 2020, 4:51pm UTC](https://discourse.julialang.org/t/trying-to-use-dash-datatable/51519 "2020-12-22T16:51:25Z")

</div>

Hi there, I’m simply trying to display a table on my dashboard, thank to DashTable. But yet it doesn’t seem really adapted to Julia. Could someone enlight me on this point? df = DataFrame(A =\["Sunny", "Snowy"\], B…

---

## [Reccomended workflow to "patch" another person's package?](https://discourse.julialang.org/t/reccomended-workflow-to-patch-another-persons-package/52220)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [December 22, 2020, 4:08pm UTC](https://discourse.julialang.org/t/reccomended-workflow-to-patch-another-persons-package/52220 "2020-12-22T16:08:19Z")

</div>

Hello, which is the “suggested” workflow to “patch” someone else package and (hopefully) automatically issue a pull request on the package ? I see that PkgDev no longer ship with a “submit(package)” function…

---

## [Reducing the number of commands when starting the REPL](https://discourse.julialang.org/t/reducing-the-number-of-commands-when-starting-the-repl/51870)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 6\
**Last updated:** [December 22, 2020, 1:10pm UTC](https://discourse.julialang.org/t/reducing-the-number-of-commands-when-starting-the-repl/51870 "2020-12-22T13:10:16Z")

</div>

When working on a package Foo, I often have to type commands like \] dev . \] activate . \] test using Foo F = Foo This, on a daily basis, means that I have to type a lot when switching between packages and when Julia occ…

---

## [Hashing tuples of tuples is seemingly very slow](https://discourse.julialang.org/t/hashing-tuples-of-tuples-is-seemingly-very-slow/52223)

<div class="topic-metadata">

**Author:** [@rdl](https://discourse.julialang.org/u/rdl)\
**Replies:** 6\
**Last updated:** [December 22, 2020, 11:15am UTC](https://discourse.julialang.org/t/hashing-tuples-of-tuples-is-seemingly-very-slow/52223 "2020-12-22T11:15:10Z")

</div>

I’ve been using Julia to complete advent of code this year. Today’s problem had a part which naturally lent itself to storing pairs of tuples of integers in a set. My program was running far more slowly that I expected t…

---

## ["The remote server returned an error: (404) Not Found."](https://discourse.julialang.org/t/the-remote-server-returned-an-error-404-not-found/52218)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 3\
**Last updated:** [December 22, 2020, 9:41am UTC](https://discourse.julialang.org/t/the-remote-server-returned-an-error-404-not-found/52218 "2020-12-22T09:41:51Z")

</div>

How to solve this alert that I receive when I perform the update? up Updating registry at \`C:\\Users\\hermesr\\.julia\\registries\\General\` Installed ArrayInterface ─ v2.14.9 Installed fzf\_jll ──────── v0.24.4+0 Downl…

---

## [Speed of broadcast operations](https://discourse.julialang.org/t/speed-of-broadcast-operations/52113)

<div class="topic-metadata">

**Author:** [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Replies:** 4\
**Last updated:** [December 22, 2020, 5:36am UTC](https://discourse.julialang.org/t/speed-of-broadcast-operations/52113 "2020-12-22T05:36:02Z")

</div>

:bowing\_man: M, N = 10000, 10000 a = randn((M, N)); ssa = sum(a); sa=sum(a, dims=1); @btime a .- ssa .- sa; @btime a .- sa .- ssa; @btime a .- (sa .+ ssa); 287.707 ms …

---

## [Growing memory with broadcast assignment](https://discourse.julialang.org/t/growing-memory-with-broadcast-assignment/52206)

<div class="topic-metadata">

**Author:** [@ancorso](https://discourse.julialang.org/u/ancorso)\
**Replies:** 6\
**Last updated:** [December 22, 2020, 1:37am UTC](https://discourse.julialang.org/t/growing-memory-with-broadcast-assignment/52206 "2020-12-22T01:37:12Z")

</div>

Here is a MWE of the problem: function foo!(v) i = rand(1:size(v, 4) - 3) v\[:,:,:,i:i+3\] .= 1. end v = Array{Float32}(undef, 105, 80, 4, 50000) for i=1:50000 foo!(v) end When I run the code, julia’s memory…

---

## [Confusing documentation on "Data-race freedom"](https://discourse.julialang.org/t/confusing-documentation-on-data-race-freedom/52197)

<div class="topic-metadata">

**Author:** [@Deduction42](https://discourse.julialang.org/u/Deduction42)\
**Replies:** 5\
**Last updated:** [December 21, 2020, 10:08pm UTC](https://discourse.julialang.org/t/confusing-documentation-on-data-race-freedom/52197 "2020-12-21T22:08:05Z")

</div>

So I’m brand new at multi-threading and I basically want to lock access to a global variable to all other threads while one task writes to it. I’m looking at the documentation Multi-Threading · The Julia Language and I c…

---

## [Unpack an object by fieldnames into local scope?](https://discourse.julialang.org/t/unpack-an-object-by-fieldnames-into-local-scope/52196)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 3\
**Last updated:** [December 21, 2020, 8:03pm UTC](https://discourse.julialang.org/t/unpack-an-object-by-fieldnames-into-local-scope/52196 "2020-12-21T20:03:23Z")

</div>

Is there a macro or syntax that will unpack an object (such as a struct or a LabelledArray) into local variables by it’s field names? So given struct MyObj a::Int b::Int end m1 = MyObj(3,4) @splatbyfnames m1 …

---

## [Remove parameters from struct type](https://discourse.julialang.org/t/remove-parameters-from-struct-type/52187)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 7\
**Last updated:** [December 21, 2020, 7:28pm UTC](https://discourse.julialang.org/t/remove-parameters-from-struct-type/52187 "2020-12-21T19:28:47Z")

</div>

Hi, Here’s a MWE: abstract type FooBar end struct Foo{T} \<: FooBar a::T end struct Bar{T} \<: FooBar a::T end struct Baz x end struct Baz2 x end Baz2(b::Baz) = Baz2(b.x) toBaz2(fb::FooBar) = typeof(fb…

---

## [Disable border around bar plot in Plots.jl](https://discourse.julialang.org/t/disable-border-around-bar-plot-in-plots-jl/47354)

<div class="topic-metadata">

**Author:** [@OvidiusCicero](https://discourse.julialang.org/u/OvidiusCicero)\
**Replies:** 4\
**Last updated:** [December 21, 2020, 5:02pm UTC](https://discourse.julialang.org/t/disable-border-around-bar-plot-in-plots-jl/47354 "2020-12-21T17:02:53Z")

</div>

Is there a way to disable the black borders around bars in bar plots in Plots.jl? With many data points they become useless and make the colors useless: n = 300 bar( range(0, 1; length=n), rand(n))

---

## [Nested iterators](https://discourse.julialang.org/t/nested-iterators/52180)

<div class="topic-metadata">

**Author:** [@phendric](https://discourse.julialang.org/u/phendric)\
**Replies:** 7\
**Last updated:** [December 21, 2020, 4:24pm UTC](https://discourse.julialang.org/t/nested-iterators/52180 "2020-12-21T16:24:05Z")

</div>

I want to nest a couple of Iterators calls, but am not getting the result I expect. I want to iterate through the cartesian product of a repeated array, except I don’t know ahead of time how many times the array will be…

---

## [Splatting of an integer](https://discourse.julialang.org/t/splatting-of-an-integer/52160)

<div class="topic-metadata">

**Author:** [@mancellin](https://discourse.julialang.org/u/mancellin)\
**Replies:** 4\
**Last updated:** [December 21, 2020, 3:31pm UTC](https://discourse.julialang.org/t/splatting-of-an-integer/52160 "2020-12-21T15:31:35Z")

</div>

Hello everyone, I was trying to write some generic code in which users can provide indices either as Ints (in 1D) or as tuples of Ints (in 2D/3D). To interface with functions like getindex, my solution was to splat the …

---

## [Assembly prescribed Stress using JuAFEM](https://discourse.julialang.org/t/assembly-prescribed-stress-using-juafem/52178)

<div class="topic-metadata">

**Author:** [@FrootLoops](https://discourse.julialang.org/u/FrootLoops)\
**Replies:** 1\
**Last updated:** [December 21, 2020, 3:20pm UTC](https://discourse.julialang.org/t/assembly-prescribed-stress-using-juafem/52178 "2020-12-21T15:20:02Z")

</div>

Checking the example incompressible\_elasticity, it is solving the equation Ku = f based on the following assemble code: function doassemble(cellvalues\_u::CellVectorValues{dim}, cellvalues\_p::CellScalarValues{dim}, …

---

## [Unable to automatically install artifact](https://discourse.julialang.org/t/unable-to-automatically-install-artifact/51984)

<div class="topic-metadata">

**Author:** [@MatthijsCox](https://discourse.julialang.org/u/MatthijsCox)\
**Replies:** 5\
**Last updated:** [December 21, 2020, 2:35pm UTC](https://discourse.julialang.org/t/unable-to-automatically-install-artifact/51984 "2020-12-21T14:35:27Z")

</div>

I’m trying to setup an automatic julia artifact download for brainflow. However I am encountering a .tar unpacking error. Let me elaborate. Here is my script to generate the artifact in a folder with an Artifacts.toml f…

---

## [Strange ‘abstract\_call’ messages before code running](https://discourse.julialang.org/t/strange-abstract-call-messages-before-code-running/52025)

<div class="topic-metadata">

**Author:** [@enjoyable](https://discourse.julialang.org/u/enjoyable)\
**Replies:** 18\
**Last updated:** [December 21, 2020, 9:19am UTC](https://discourse.julialang.org/t/strange-abstract-call-messages-before-code-running/52025 "2020-12-21T09:19:16Z")

</div>

Hi I have been encountering this problem for both Julia 1.5.3 and 1.5, under both Julia Pro and VS Code. Whenever I ran codes in Julia, there will always be some strange messages in the terminal, like inlineeval##kw at…

---

## [Replacing missing values in dataframe-convert-type-union-float64-is-ambiguous](https://discourse.julialang.org/t/replacing-missing-values-in-dataframe-convert-type-union-float64-is-ambiguous/52119)

<div class="topic-metadata">

**Author:** [@new\_julia\_enthusiast](https://discourse.julialang.org/u/new_julia_enthusiast)\
**Replies:** 6\
**Last updated:** [December 21, 2020, 4:19am UTC](https://discourse.julialang.org/t/replacing-missing-values-in-dataframe-convert-type-union-float64-is-ambiguous/52119 "2020-12-21T04:19:59Z")

</div>

Hi, I am a new Julia user and I am having difficulty imputing missing values in my dataframe. The replacement value is dependent on the position of the column and other values in that row. Coming from a Java background, …

---

## [Julia equivalent of the Python \`slice\` class](https://discourse.julialang.org/t/julia-equivalent-of-the-python-slice-class/52152)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 4\
**Last updated:** [December 21, 2020, 3:10am UTC](https://discourse.julialang.org/t/julia-equivalent-of-the-python-slice-class/52152 "2020-12-21T03:10:02Z")

</div>

In Python I can store an index range into a variable and reuse it. In particular, I can store a range with implicit begin-at-0 and end-at-end-of-list extremas. How do I do the following in Julia: my\_list = \[1,2,3,4,5,6…

---

## [Push into array of arrays does not work when type is specified](https://discourse.julialang.org/t/push-into-array-of-arrays-does-not-work-when-type-is-specified/52151)

<div class="topic-metadata">

**Author:** [@ZdM87](https://discourse.julialang.org/u/ZdM87)\
**Replies:** 1\
**Last updated:** [December 21, 2020, 2:20am UTC](https://discourse.julialang.org/t/push-into-array-of-arrays-does-not-work-when-type-is-specified/52151 "2020-12-21T02:20:02Z")

</div>

Why the following code works using Combinatorics all\_sequences = \[\] for i in 2:4 for j in permutations(1:4, i) push!(all\_sequences, collect(j)) end end and this one does not using Combinatorics all\_s…

---

## [Very simple code, why would there be performance problems](https://discourse.julialang.org/t/very-simple-code-why-would-there-be-performance-problems/51848)

<div class="topic-metadata">

**Author:** [@Zq\_F](https://discourse.julialang.org/u/Zq_F)\
**Replies:** 12\
**Last updated:** [December 21, 2020, 1:25am UTC](https://discourse.julialang.org/t/very-simple-code-why-would-there-be-performance-problems/51848 "2020-12-21T01:25:21Z")

</div>

Hello, everyone Very simple code, the speed is really slow, I suspect that the method of using Ref in the structure is wrong Everyone, please take a look, thank you mutable struct T3 f1::Int64 f2::String f3::Fl…

---

## [Abstract type hierarchies along with OOP constructed types](https://discourse.julialang.org/t/abstract-type-hierarchies-along-with-oop-constructed-types/52100)

<div class="topic-metadata">

**Author:** [@emmettgb](https://discourse.julialang.org/u/emmettgb)\
**Replies:** 5\
**Last updated:** [December 21, 2020, 12:54am UTC](https://discourse.julialang.org/t/abstract-type-hierarchies-along-with-oop-constructed-types/52100 "2020-12-21T00:54:05Z")

</div>

Hi guys, I am new to Julia’s Discourse, but rather familiar with Julia. I maintain a package called Lathe.jl which is an object-oriented machine-learning package in Julia with syntax similar to SkLearn. As such, for an e…

---

## [Creating a matrix from array of arrays without changing order of dimensions](https://discourse.julialang.org/t/creating-a-matrix-from-array-of-arrays-without-changing-order-of-dimensions/52143)

<div class="topic-metadata">

**Author:** [@Tobias-Thomas](https://discourse.julialang.org/u/Tobias-Thomas)\
**Replies:** 5\
**Last updated:** [December 20, 2020, 8:56pm UTC](https://discourse.julialang.org/t/creating-a-matrix-from-array-of-arrays-without-changing-order-of-dimensions/52143 "2020-12-20T20:56:58Z")

</div>

As far as I know the way in julia to create a 2D-Matrix from an Array of 1D-arrays is to use hcat(a...). My problem now is that it seems that julia’s column-major style of arrays changes the order of dimensions. a = \[\[1…

---

## [Sorting: use of keyword by and lt](https://discourse.julialang.org/t/sorting-use-of-keyword-by-and-lt/52116)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 8\
**Last updated:** [December 20, 2020, 2:51pm UTC](https://discourse.julialang.org/t/sorting-use-of-keyword-by-and-lt/52116 "2020-12-20T14:51:26Z")

</div>

I tried to solve the problem proposed here using the function SORT() with the BY and LT keywords. In particular I tried with the following dataframe and expression: df = DataFrame(NAME = \["A1","A1","A2", "A1","A2","A…

---

## [Custom array index, multiple index one value](https://discourse.julialang.org/t/custom-array-index-multiple-index-one-value/52041)

<div class="topic-metadata">

**Author:** [@Atomtomate](https://discourse.julialang.org/u/Atomtomate)\
**Replies:** 4\
**Last updated:** [December 20, 2020, 1:32pm UTC](https://discourse.julialang.org/t/custom-array-index-multiple-index-one-value/52041 "2020-12-20T13:32:38Z")

</div>

Hello there, my question is about the optimal way to realize the following data structure in Julia: I have a couple of very large rank 4 arrays from a numerical simulation. Typical, these have around 500^4 complex valu…

---

## [Cannot plot in interactive mode](https://discourse.julialang.org/t/cannot-plot-in-interactive-mode/52111)

<div class="topic-metadata">

**Author:** [@nikolasborrel](https://discourse.julialang.org/u/nikolasborrel)\
**Replies:** 0\
**Last updated:** [December 19, 2020, 11:45pm UTC](https://discourse.julialang.org/t/cannot-plot-in-interactive-mode/52111 "2020-12-19T23:45:24Z")

</div>

I’m struggling with plotting in interactive mode in VS Code (without Jupyter Lab). According to Backends · Plots, Plotly(JS), PyPlot, InspectDR are most suitable. I’m plotting surface plots of triangles: x, y and z are …

---

## [How fast ist a binary file from packagecomplier.jl and what is its file size](https://discourse.julialang.org/t/how-fast-ist-a-binary-file-from-packagecomplier-jl-and-what-is-its-file-size/51415)

<div class="topic-metadata">

**Author:** [@boroboro77](https://discourse.julialang.org/u/boroboro77)\
**Replies:** 3\
**Last updated:** [December 19, 2020, 11:20pm UTC](https://discourse.julialang.org/t/how-fast-ist-a-binary-file-from-packagecomplier-jl-and-what-is-its-file-size/51415 "2020-12-19T23:20:03Z")

</div>

Hello, If I create a binary file using packagecompliler.jl, will the code be as (or almost as) fast as a C++ binary file? Or are there any hidden performance issues? If I use any external library, will the size of the…

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

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