# General Usage

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

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

**Page:** 363

---

## [How to get average salary for each experience level for each job title?](https://discourse.julialang.org/t/how-to-get-average-salary-for-each-experience-level-for-each-job-title/91003)

<div class="topic-metadata">

**Author:** [@akshdfyehd](https://discourse.julialang.org/u/akshdfyehd)\
**Replies:** 1\
**Last updated:** [November 29, 2022, 5:52pm UTC](https://discourse.julialang.org/t/how-to-get-average-salary-for-each-experience-level-for-each-job-title/91003 "2022-11-29T17:52:57Z")

</div>

Hi, I got the dataset like following: I would like to get average salary for each experience level in each job title, I have tried: second=combine(groupby(new,:experience\_level,),:salary\_in\_usd =\>IMD.mean) but the…

---

## [How to add multiple columns to a dataframe at once](https://discourse.julialang.org/t/how-to-add-multiple-columns-to-a-dataframe-at-once/91007)

<div class="topic-metadata">

**Author:** [@adz](https://discourse.julialang.org/u/adz)\
**Replies:** 2\
**Last updated:** [November 29, 2022, 5:37pm UTC](https://discourse.julialang.org/t/how-to-add-multiple-columns-to-a-dataframe-at-once/91007 "2022-11-29T17:37:44Z")

</div>

I have a matrix and a vector of names. I want to add the elements of t to my dataframe, df. However, when I try to set multiple columns at once, my code fails. See the example below: df = DataFrame(A=rand(4), B=rand(4))…

---

## [Turing sampling from MatrixNormal returns \`MethodError: no method matching bijector(::MatrixNormal\`](https://discourse.julialang.org/t/turing-sampling-from-matrixnormal-returns-methoderror-no-method-matching-bijector-matrixnormal/91005)

<div class="topic-metadata">

**Author:** [@Rodrigo\_Zepeda](https://discourse.julialang.org/u/Rodrigo_Zepeda)\
**Replies:** 0\
**Last updated:** [November 29, 2022, 3:55pm UTC](https://discourse.julialang.org/t/turing-sampling-from-matrixnormal-returns-methoderror-no-method-matching-bijector-matrixnormal/91005 "2022-11-29T15:55:00Z")

</div>

Hi! I’m trying to sample from a MatrixNormal in Turing.jl running the model below (I’m just playing around with matrix distributions there is no deeper reason for this). However I keep running into the following error (w…

---

## [Wield behavior of multiple dispatch](https://discourse.julialang.org/t/wield-behavior-of-multiple-dispatch/90986)

<div class="topic-metadata">

**Author:** [@1115](https://discourse.julialang.org/u/1115)\
**Replies:** 6\
**Last updated:** [November 29, 2022, 3:24pm UTC](https://discourse.julialang.org/t/wield-behavior-of-multiple-dispatch/90986 "2022-11-29T15:24:20Z")

</div>

In Julia 1.8.3. Given the following two type signatures. (x::AbstractFloat, y::Number) (x::Union{Float64, ComplexF64}, y::Union{Float64, ComplexF64}) I would expect there being an ambiguity error if the input type is (…

---

## [Axis problem with Plots.jl and plotlyjs()](https://discourse.julialang.org/t/axis-problem-with-plots-jl-and-plotlyjs/90989)

<div class="topic-metadata">

**Author:** [@Jonas\_Nilsson](https://discourse.julialang.org/u/Jonas_Nilsson)\
**Replies:** 0\
**Last updated:** [November 29, 2022, 11:46am UTC](https://discourse.julialang.org/t/axis-problem-with-plots-jl-and-plotlyjs/90989 "2022-11-29T11:46:04Z")

</div>

New Julia user that is basically trying to navigate my way through the massive jungle consisting of all the different plotting options. Have sort of settled on using Plots.jl with PlotlyJS as backend. However, I have ec…

---

## [Inconsistent errors](https://discourse.julialang.org/t/inconsistent-errors/90903)

<div class="topic-metadata">

**Author:** [@Ran\_Yaacoby](https://discourse.julialang.org/u/Ran_Yaacoby)\
**Replies:** 2\
**Last updated:** [November 29, 2022, 10:47am UTC](https://discourse.julialang.org/t/inconsistent-errors/90903 "2022-11-29T10:47:02Z")

</div>

I’m running the same script multiple times, around 1000 times, and I get inconsistent errors. The errors I randomly get are: 1) “ERROR: LoadError: syntax: invalid character “” near column 1” 2) “ERROR: LoadError: Dime…

---

## [Correct my Plot for $x \\lfoor x \\rfloor$](https://discourse.julialang.org/t/correct-my-plot-for-x-lfoor-x-rfloor/90981)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 0\
**Last updated:** [November 29, 2022, 8:44am UTC](https://discourse.julialang.org/t/correct-my-plot-for-x-lfoor-x-rfloor/90981 "2022-11-29T08:44:19Z")

</div>

I do not know whether my plot is correct or not, I see the solution of definite integral is like this along with my plot. This is my code: using Plots,LaTeXStrings,Colors gr() f(x) = (x^2)\*floor(x) x = -4:1:4 y = f…

---

## [Does Julia recompile if the redefinition of the function is the same](https://discourse.julialang.org/t/does-julia-recompile-if-the-redefinition-of-the-function-is-the-same/90972)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 8\
**Last updated:** [November 29, 2022, 7:13am UTC](https://discourse.julialang.org/t/does-julia-recompile-if-the-redefinition-of-the-function-is-the-same/90972 "2022-11-29T07:13:40Z")

</div>

Say I have a function foo(x) that takes a long time to compile. Suppose I have already defined the function and called it once so that it is compiled. Then say I redefined foo(x) with the exact same definition and then …

---

## [Is there any way to extract the name of the parameter from the ODE function](https://discourse.julialang.org/t/is-there-any-way-to-extract-the-name-of-the-parameter-from-the-ode-function/90923)

<div class="topic-metadata">

**Author:** [@YiboXia](https://discourse.julialang.org/u/YiboXia)\
**Replies:** 10\
**Last updated:** [November 29, 2022, 2:28am UTC](https://discourse.julialang.org/t/is-there-any-way-to-extract-the-name-of-the-parameter-from-the-ode-function/90923 "2022-11-29T02:28:21Z")

</div>

Hi! I want to extract the name of the parameter from the ODE function to make the tuple out of given parameters. For example, we have an ODE function: function f(du,u,p,t) a, b = p x = u du\[1\] = a \* x+b \* x^2 e…

---

## [Makie+Pluto: How to display animations in the cell?](https://discourse.julialang.org/t/makie-pluto-how-to-display-animations-in-the-cell/68195)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 3\
**Last updated:** [November 28, 2022, 10:19pm UTC](https://discourse.julialang.org/t/makie-pluto-how-to-display-animations-in-the-cell/68195 "2022-11-28T22:19:48Z")

</div>

My WGLMakie does not work. Can other backends be used to make animations in the cell? OS: MacOS 11.5.2 julia: 1.6.0 Pluto: 0.16.0 WGLMakie: 0.4.5 In Pluto, Cell 1: using WGLMakie using JSServe Cell 2 Page() Erro…

---

## [Storing high precision constants to use with fixed precision libraries (DoubleFloats.jl, Quadmath.jl, DecFP.jl, etc.)](https://discourse.julialang.org/t/storing-high-precision-constants-to-use-with-fixed-precision-libraries-doublefloats-jl-quadmath-jl-decfp-jl-etc/90967)

<div class="topic-metadata">

**Author:** [@heltonmc](https://discourse.julialang.org/u/heltonmc)\
**Replies:** 3\
**Last updated:** [November 28, 2022, 9:55pm UTC](https://discourse.julialang.org/t/storing-high-precision-constants-to-use-with-fixed-precision-libraries-doublefloats-jl-quadmath-jl-decfp-jl-etc/90967 "2022-11-28T21:55:41Z")

</div>

I am hoping to design algorithms that can be used efficiently with other fixed higher precision libraries such as DoubleFloats.jl, Quadmath.jl, DecFP.jl, MultiFloats.jl, etc… This usually involves polynomial approximatio…

---

## [Convert Numpy Arrays to Julia Arrays by Default PythonCall/JuliaCall](https://discourse.julialang.org/t/convert-numpy-arrays-to-julia-arrays-by-default-pythoncall-juliacall/90671)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 5\
**Last updated:** [November 28, 2022, 9:51pm UTC](https://discourse.julialang.org/t/convert-numpy-arrays-to-julia-arrays-by-default-pythoncall-juliacall/90671 "2022-11-28T21:51:14Z")

</div>

I am currently writing an interface between a Python program and a Julia Package; I would like to call the functions in the Julia package from Python. The functions in the Julia package all have type declarations, and fo…

---

## [Constant dash density in Plots.jl](https://discourse.julialang.org/t/constant-dash-density-in-plots-jl/34087)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 12\
**Last updated:** [November 28, 2022, 9:41pm UTC](https://discourse.julialang.org/t/constant-dash-density-in-plots-jl/34087 "2022-11-28T21:41:46Z")

</div>

Hi, I have a plot where I want to display some dash. But as the density of points increases, the dashes merge and become a straight line. This can be seen on the left of the plot near x=0.02. Does anybody knows how to…

---

## [ODE solver with too many function calls](https://discourse.julialang.org/t/ode-solver-with-too-many-function-calls/90686)

<div class="topic-metadata">

**Author:** [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Replies:** 23\
**Last updated:** [November 28, 2022, 7:48pm UTC](https://discourse.julialang.org/t/ode-solver-with-too-many-function-calls/90686 "2022-11-28T19:48:40Z")

</div>

Hello, I am using an Ode solver to simulate a mechanical system with a mass and a spring. Besides the spring and an external force there is a nonlinear force acting on the system. Each computation takes around 4 ms. Wh…

---

## [DataFrame construction from array of tuples](https://discourse.julialang.org/t/dataframe-construction-from-array-of-tuples/11426)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 12\
**Last updated:** [November 28, 2022, 5:01pm UTC](https://discourse.julialang.org/t/dataframe-construction-from-array-of-tuples/11426 "2022-11-28T17:01:29Z")

</div>

Hi all. What’s the best way to convert an array of tuples into a DataFrame? For example, I’d like to construct a data frame with column names :a and :b for the data below: julia\> data = \[(1,2),(4,5)\] 2-element Array{T…

---

## [1.8 much slower than 1.6](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 26\
**Last updated:** [November 28, 2022, 3:55pm UTC](https://discourse.julialang.org/t/1-8-much-slower-than-1-6/89254 "2022-11-28T15:55:42Z")

</div>

Hi all :slight\_smile: I stumbled over a very strange thing. I’m updating from 1.6 to 1.8. The only problem all the scripts use much more CPU even to a point where everything is used. The scripts are CPU intensive and us…

---

## [Memory address of a set, array, string,](https://discourse.julialang.org/t/memory-address-of-a-set-array-string/90717)

<div class="topic-metadata">

**Author:** [@Vahid\_Hosseinzadeh](https://discourse.julialang.org/u/Vahid_Hosseinzadeh)\
**Replies:** 4\
**Last updated:** [November 28, 2022, 1:00pm UTC](https://discourse.julialang.org/t/memory-address-of-a-set-array-string/90717 "2022-11-28T13:00:15Z")

</div>

I run the following and get error pointer\_from\_objref(Set(\[1,2,3\])) #error pointer\_from\_objref cannot be used on immutable objects however as I understand, Sets are mutable. About the strings and arrays, pointer() a…

---

## [Figures not showing after depolyment with Documenter](https://discourse.julialang.org/t/figures-not-showing-after-depolyment-with-documenter/90941)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 4\
**Last updated:** [November 28, 2022, 12:08pm UTC](https://discourse.julialang.org/t/figures-not-showing-after-depolyment-with-documenter/90941 "2022-11-28T12:08:48Z")

</div>

When I deploy my documentation locally I’m able to get figures appearing in my examples. However when I deploy it on GitLab it does not (see here). I have spent a lot of time just getting the documentation to deploy (lo…

---

## [How to Create Riemann Sum animation in JULIA?](https://discourse.julialang.org/t/how-to-create-riemann-sum-animation-in-julia/90942)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 0\
**Last updated:** [November 28, 2022, 10:18am UTC](https://discourse.julialang.org/t/how-to-create-riemann-sum-animation-in-julia/90942 "2022-11-28T10:18:10Z")

</div>

Hi all, is there an example of how to create Riemann Sum animation in JULIA? I look over and found nothing, any source to learn? I have a Python example, but then it is JULIA discourse … so? Thanks before.

---

## [Structure binding in Julia?](https://discourse.julialang.org/t/structure-binding-in-julia/90931)

<div class="topic-metadata">

**Author:** [@gtgt](https://discourse.julialang.org/u/gtgt)\
**Replies:** 4\
**Last updated:** [November 28, 2022, 8:41am UTC](https://discourse.julialang.org/t/structure-binding-in-julia/90931 "2022-11-28T08:41:05Z")

</div>

Is there anyway to destructure using variable names different from fields? struct S x::Int y::Int end s = S(1, 2) (; x, y) = s # ok (; a, b) = s # error: Type S has no field a In C++ I can do the following s…

---

## [How to define a simple Boolean term rewriter properly in Symbolics?](https://discourse.julialang.org/t/how-to-define-a-simple-boolean-term-rewriter-properly-in-symbolics/90749)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 1\
**Last updated:** [November 28, 2022, 7:09am UTC](https://discourse.julialang.org/t/how-to-define-a-simple-boolean-term-rewriter-properly-in-symbolics/90749 "2022-11-28T07:09:06Z")

</div>

We know that a & a = a holds for a Boolean variable a. However, this rule is missing in SymbolicUtils.jl. julia\> using SymbolicUtils julia\> r = @rule ~x & ~x =\> ~x ~x & ~x =\> ~x julia\> @syms a::Bool b::Bool (a, b) j…

---

## [Change Julia version in Python through PyCall](https://discourse.julialang.org/t/change-julia-version-in-python-through-pycall/90932)

<div class="topic-metadata">

**Author:** [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Replies:** 0\
**Last updated:** [November 28, 2022, 3:24am UTC](https://discourse.julialang.org/t/change-julia-version-in-python-through-pycall/90932 "2022-11-28T03:24:37Z")

</div>

I want to use julia package in python environment through PyCall. I have two julia version in atom: v1.6 and v1.8. First installed PyCall in v1.6, and add PyCall、Pkg.build("PyCall"), I could use the julia v1.6 package…

---

## [Is there any package supporting Samba? or is there any workaround?](https://discourse.julialang.org/t/is-there-any-package-supporting-samba-or-is-there-any-workaround/90357)

<div class="topic-metadata">

**Author:** [@Bondan000](https://discourse.julialang.org/u/Bondan000)\
**Replies:** 2\
**Last updated:** [November 28, 2022, 2:36am UTC](https://discourse.julialang.org/t/is-there-any-package-supporting-samba-or-is-there-any-workaround/90357 "2022-11-28T02:36:44Z")

</div>

Hi all, I am trying to host a simple Dash.jl based webapp in an Openshift cloud platform. The webapp has to fetch a file from a windows share! I can’t access the file within openshift! with samba connector i be able to …

---

## [Citations in docs](https://discourse.julialang.org/t/citations-in-docs/5066)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 40\
**Last updated:** [November 28, 2022, 1:48am UTC](https://discourse.julialang.org/t/citations-in-docs/5066 "2022-11-28T01:48:53Z")

</div>

Is it possible to have bibtex references in your docs? something along the lines of "Computes a p-value that can never be misinterepreted \[@fisher\]" function pvalue() ... end That will then be replaced with both an…

---

## [Matrix vs Matrix{Any}](https://discourse.julialang.org/t/matrix-vs-matrix-any/90911)

<div class="topic-metadata">

**Author:** [@KwatME](https://discourse.julialang.org/u/KwatME)\
**Replies:** 6\
**Last updated:** [November 27, 2022, 11:21pm UTC](https://discourse.julialang.org/t/matrix-vs-matrix-any/90911 "2022-11-27T23:21:00Z")

</div>

Can someone please explain why separation of the code that loops the Matrix improves the code? In code\_warntype, I noticed the difference between Matrix and Matrix{Any}. Thank you. The source is here https://github.c…

---

## [How to delay the load of dependencies in a module to "using" time?](https://discourse.julialang.org/t/how-to-delay-the-load-of-dependencies-in-a-module-to-using-time/90914)

<div class="topic-metadata">

**Author:** [@jgidi](https://discourse.julialang.org/u/jgidi)\
**Replies:** 4\
**Last updated:** [November 27, 2022, 8:38pm UTC](https://discourse.julialang.org/t/how-to-delay-the-load-of-dependencies-in-a-module-to-using-time/90914 "2022-11-27T20:38:19Z")

</div>

Hi, community! When a module is defined, such as in module MyModule using PyCall end the module PyCall will be loaded, even if you haven’t run using .MyModule. The main question is: Is it possible to delay this load …

---

## [Speed up "bool ^ float" and "float ^ bool"](https://discourse.julialang.org/t/speed-up-bool-float-and-float-bool/90701)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 24\
**Last updated:** [November 27, 2022, 7:56pm UTC](https://discourse.julialang.org/t/speed-up-bool-float-and-float-bool/90701 "2022-11-27T19:56:41Z")

</div>

I speed up “bool ^ float” and “float ^ bool”. Сan you help me to know how it works on other processors ? Need a print of this thing: module M using BenchmarkTools, Test, InteractiveUtils println("\*\*", rstrip(Sys.cp…

---

## [How to Append Polynomial to 5-element vector if the highest order is less than 4? Polynomials.jl Package](https://discourse.julialang.org/t/how-to-append-polynomial-to-5-element-vector-if-the-highest-order-is-less-than-4-polynomials-jl-package/90904)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [November 27, 2022, 6:30pm UTC](https://discourse.julialang.org/t/how-to-append-polynomial-to-5-element-vector-if-the-highest-order-is-less-than-4-polynomials-jl-package/90904 "2022-11-27T18:30:11Z")

</div>

Hi all I have a problem here, I want to calculate special sum by using Polynomials.jl, thus it works fine if there is one of degree 4, but if the highest input is of degree 2, the coeffs(p) would become 3-element vector…

---

## [Calculate Area of Function with Circumscribed Polygon with CalculusWithJulia](https://discourse.julialang.org/t/calculate-area-of-function-with-circumscribed-polygon-with-calculuswithjulia/90895)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [November 27, 2022, 4:08pm UTC](https://discourse.julialang.org/t/calculate-area-of-function-with-circumscribed-polygon-with-calculuswithjulia/90895 "2022-11-27T16:08:36Z")

</div>

Hi all, I try to calculate this function $3x^{2} + x + 1$ But, I get the result different from the solution: This is the code I use: using CalculusWithJulia function riemann(f, a, b, n; method="right") xs = a:…

---

## [Compile time conditions or dispatch removing code based on (DEBUG, LIVE) mode](https://discourse.julialang.org/t/compile-time-conditions-or-dispatch-removing-code-based-on-debug-live-mode/89134)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 7\
**Last updated:** [November 27, 2022, 2:59pm UTC](https://discourse.julialang.org/t/compile-time-conditions-or-dispatch-removing-code-based-on-debug-live-mode/89134 "2022-11-27T14:59:32Z")

</div>

Hey Julianners! Conditional code compilation would be Crazy! I want to make a code where I don’t have to comment out some of my code when I run my code in live version. I know I am talking about 10-20 conditions only b…

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

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