# General Usage

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

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

**Page:** 692

---

## [How to treat Python namedtuple-inherited class in PyCall](https://discourse.julialang.org/t/how-to-treat-python-namedtuple-inherited-class-in-pycall/48197)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 0\
**Last updated:** [October 12, 2020, 6:57am UTC](https://discourse.julialang.org/t/how-to-treat-python-namedtuple-inherited-class-in-pycall/48197 "2020-10-12T06:57:30Z")

</div>

How to let not to automatically convert Python namedtuple-inherited class to Julia tuple in PyCall? The following documents have the example such situation: https://pytorch.org/docs/stable/generated/torch.nn.utils.rnn.p…

---

## [Mac installation totally busted](https://discourse.julialang.org/t/mac-installation-totally-busted/48191)

<div class="topic-metadata">

**Author:** [@igorrivin](https://discourse.julialang.org/u/igorrivin)\
**Replies:** 4\
**Last updated:** [October 12, 2020, 4:46am UTC](https://discourse.julialang.org/t/mac-installation-totally-busted/48191 "2020-10-12T04:46:03Z")

</div>

I tried to install Julia 1.5.2 on my Mac, but there is a typo in the script: igor@Igors-MacBook-Pro ~ % xec ‘/private/var/folders/tx/3vwvrf2n56502g3fbglg7csw0000gn/T/AppTranslocation/A7E0A413-761B-4EF0-A31B-09ECD37DFC68…

---

## [Unable to add MLJ.jl package multiple unsatisfiable requirements](https://discourse.julialang.org/t/unable-to-add-mlj-jl-package-multiple-unsatisfiable-requirements/48192)

<div class="topic-metadata">

**Author:** [@psabela](https://discourse.julialang.org/u/psabela)\
**Replies:** 1\
**Last updated:** [October 12, 2020, 4:41am UTC](https://discourse.julialang.org/t/unable-to-add-mlj-jl-package-multiple-unsatisfiable-requirements/48192 "2020-10-12T04:41:29Z")

</div>

julia\> Pkg.add(url=“https://github.com/alan-turing-institute/MLJ.jl”) Updating git-repo https://github.com/alan-turing-institute/MLJ.jl Resolving package versions… ERROR: Unsatisfiable requirements detected for packag…

---

## [Doubt regarding Broadcast assignment of 1d Arrays and Vectors](https://discourse.julialang.org/t/doubt-regarding-broadcast-assignment-of-1d-arrays-and-vectors/48189)

<div class="topic-metadata">

**Author:** [@Sarthak\_Choudhury](https://discourse.julialang.org/u/Sarthak_Choudhury)\
**Replies:** 4\
**Last updated:** [October 12, 2020, 3:22am UTC](https://discourse.julialang.org/t/doubt-regarding-broadcast-assignment-of-1d-arrays-and-vectors/48189 "2020-10-12T03:22:23Z")

</div>

Hi, I am new to Julia. I had a doubt regarding 1d arrays and vectors. If they represent the same thing then usually you can do algebraic functions on them but I found you cannot do assignment via broadcasting. A simple …

---

## [Summing (StatsModels) terms](https://discourse.julialang.org/t/summing-statsmodels-terms/47648)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 10\
**Last updated:** [October 11, 2020, 9:09pm UTC](https://discourse.julialang.org/t/summing-statsmodels-terms/47648 "2020-10-11T21:09:55Z")

</div>

I know that I can do ts = term(:x) spec = ts ~ term(1) + sum(lag(ts, i) for i in 1:n) which just puts n lags of this variable separately on the right hand side of the equation. How can I combine them, so that sum(lag(…

---

## [Fastest way to \`unique!\`](https://discourse.julialang.org/t/fastest-way-to-unique/47952)

<div class="topic-metadata">

**Author:** [@abulak](https://discourse.julialang.org/u/abulak)\
**Replies:** 17\
**Last updated:** [October 11, 2020, 5:33pm UTC](https://discourse.julialang.org/t/fastest-way-to-unique/47952 "2020-10-11T17:33:14Z")

</div>

Problem formulation I have an array old::Vector{T} of somewhat complicated structs; I have an array new::Vector{T} of other complicated structs. I want an array result::Vector{T} which contains a single element for eac…

---

## [IJulia Installation Problem](https://discourse.julialang.org/t/ijulia-installation-problem/48169)

<div class="topic-metadata">

**Author:** [@Zehra112](https://discourse.julialang.org/u/Zehra112)\
**Replies:** 0\
**Last updated:** [October 11, 2020, 4:04pm UTC](https://discourse.julialang.org/t/ijulia-installation-problem/48169 "2020-10-11T16:04:03Z")

</div>

Hi everyone, I have just installed Julia v.1.5.2(Sep 23,2020). I am new in Juila, and I want to add IJulia. → \] → add IJulia are my steps, but I get an error. I read some questions about this before but I coudnt fix my p…

---

## [How to create a help (?) entry for a custom function?](https://discourse.julialang.org/t/how-to-create-a-help-entry-for-a-custom-function/48165)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [October 11, 2020, 3:40pm UTC](https://discourse.julialang.org/t/how-to-create-a-help-entry-for-a-custom-function/48165 "2020-10-11T15:40:25Z")

</div>

I could not find in the docs how to create a ? entry for a function of a custom package. (meaning, the information that appears when one types ? function in the REPL). Searching for “?”, “help”, “help entry repl” didn’t…

---

## [Error using plot function](https://discourse.julialang.org/t/error-using-plot-function/47743)

<div class="topic-metadata">

**Author:** [@Hrishikesh\_Das](https://discourse.julialang.org/u/Hrishikesh_Das)\
**Replies:** 6\
**Last updated:** [October 11, 2020, 2:49pm UTC](https://discourse.julialang.org/t/error-using-plot-function/47743 "2020-10-11T14:49:43Z")

</div>

I am new to Julia. I am using a 64 bit Windows 7 OS. Julia Version is 1.5.2. I installed the Plots package but I cannot use the plot function. using Plots x = 1:10; y = rand(10, 2) plot(x, y) I am getting this error. …

---

## [Questions about saving data to a DataFrame](https://discourse.julialang.org/t/questions-about-saving-data-to-a-dataframe/48156)

<div class="topic-metadata">

**Author:** [@adeil](https://discourse.julialang.org/u/adeil)\
**Replies:** 1\
**Last updated:** [October 11, 2020, 1:13pm UTC](https://discourse.julialang.org/t/questions-about-saving-data-to-a-dataframe/48156 "2020-10-11T13:13:53Z")

</div>

In this my code the Dataframe appears only one line. I’d like him to keep all the movement data. using Printf v₀ = 3 # velocidade inicial g = 9.81 # aceleração da gravidade t = range(0,1, length=100) # 1000 pontos no…

---

## [Is there a \`find\_include\`/\`find\_header\` function similar to \`Libdl\`'s \`find\_library\` function?](https://discourse.julialang.org/t/is-there-a-find-include-find-header-function-similar-to-libdl-s-find-library-function/48145)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 0\
**Last updated:** [October 11, 2020, 6:15am UTC](https://discourse.julialang.org/t/is-there-a-find-include-find-header-function-similar-to-libdl-s-find-library-function/48145 "2020-10-11T06:15:31Z")

</div>

In trixi-framework/P4est.jl#9 we are trying to allow swapping the p4est library backend at package build time, similar to what MPI.jl does. However, in addition to the library itself we require the corresponding header f…

---

## [Understanding the performance costs of generating functions on the fly](https://discourse.julialang.org/t/understanding-the-performance-costs-of-generating-functions-on-the-fly/47990)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 10\
**Last updated:** [October 11, 2020, 12:35am UTC](https://discourse.julialang.org/t/understanding-the-performance-costs-of-generating-functions-on-the-fly/47990 "2020-10-11T00:35:37Z")

</div>

Hello, I’m trying to figure out the best way for DataFramesMeta and I want to understand the performance implications of the following. Go through an expression and find all the symbols that are in the propertynames of…

---

## [Is there an equivalent to dplyr::across](https://discourse.julialang.org/t/is-there-an-equivalent-to-dplyr-across/48129)

<div class="topic-metadata">

**Author:** [@Derek\_Vetsch](https://discourse.julialang.org/u/Derek_Vetsch)\
**Replies:** 2\
**Last updated:** [October 11, 2020, 12:04am UTC](https://discourse.julialang.org/t/is-there-an-equivalent-to-dplyr-across/48129 "2020-10-11T00:04:59Z")

</div>

So I am trying to switch my employer’s credit modeling code base over to Julia but am running into issues with wide datasets. In R you can apply a function to multiple columns columnwise, for example using dplyr to squar…

---

## [Geometry calculations with STL file?](https://discourse.julialang.org/t/geometry-calculations-with-stl-file/48126)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 5\
**Last updated:** [October 10, 2020, 10:24pm UTC](https://discourse.julialang.org/t/geometry-calculations-with-stl-file/48126 "2020-10-10T22:24:42Z")

</div>

I have a friend who wants to calculate some things based on geometry described by STL files (basically he’s got an OpenSCAD model, and he wants to do things like calculate the volumes of different things, and then based …

---

## [HTTP: How save a Cookie](https://discourse.julialang.org/t/http-how-save-a-cookie/48122)

<div class="topic-metadata">

**Author:** [@Jea](https://discourse.julialang.org/u/Jea)\
**Replies:** 0\
**Last updated:** [October 10, 2020, 7:34pm UTC](https://discourse.julialang.org/t/http-how-save-a-cookie/48122 "2020-10-10T19:34:12Z")

</div>

How can I save a cookie with HTTP.jl (https://github.com/JuliaWeb/HTTP.jl) in a persistent way, with its due expiration date

---

## [ANN: Reverse Cuthill-McKee sparse matrix renumbering](https://discourse.julialang.org/t/ann-reverse-cuthill-mckee-sparse-matrix-renumbering/44427)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [October 10, 2020, 5:43pm UTC](https://discourse.julialang.org/t/ann-reverse-cuthill-mckee-sparse-matrix-renumbering/44427 "2020-10-10T17:43:19Z")

</div>

In the process of being registered: https://github.com/JuliaRegistries/General/pull/19106

---

## [Error in mul!(c,a,b) if size(b) = (n,1)](https://discourse.julialang.org/t/error-in-mul-c-a-b-if-size-b-n-1/47999)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 28\
**Last updated:** [October 10, 2020, 2:50pm UTC](https://discourse.julialang.org/t/error-in-mul-c-a-b-if-size-b-n-1/47999 "2020-10-10T14:50:09Z")

</div>

Just to put in context. If I read using DelimitedFiles the data from a file with a single column of data, with, for example, x = readdlm("./data.txt") x is returned as an Array{Float64,2} with sizes (n,1). If I try dir…

---

## [Does Optim not support function optimization with matrix variables?](https://discourse.julialang.org/t/does-optim-not-support-function-optimization-with-matrix-variables/47475)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 14\
**Last updated:** [October 10, 2020, 11:49am UTC](https://discourse.julialang.org/t/does-optim-not-support-function-optimization-with-matrix-variables/47475 "2020-10-10T11:49:16Z")

</div>

I want to optimize my function with Optim, but something went wrong . I have written an example. Does this example show that optim.jl does not support functions whose variables are matrices?If not, what should I do about…

---

## [Which package/function for signed distance fields?](https://discourse.julialang.org/t/which-package-function-for-signed-distance-fields/43487)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 3\
**Last updated:** [October 10, 2020, 9:44am UTC](https://discourse.julialang.org/t/which-package-function-for-signed-distance-fields/43487 "2020-10-10T09:44:02Z")

</div>

I need a signed distance field (SDF) and corresponding unit normal vector field (acronym unknown) to immerse solid boundaries into my fluid simulator. I’m trying to use “other people’s code” wherever possible on this pro…

---

## [Julia on cluster, only MPI transport allowed](https://discourse.julialang.org/t/julia-on-cluster-only-mpi-transport-allowed/47958)

<div class="topic-metadata">

**Author:** [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Replies:** 7\
**Last updated:** [October 10, 2020, 7:44am UTC](https://discourse.julialang.org/t/julia-on-cluster-only-mpi-transport-allowed/47958 "2020-10-10T07:44:16Z")

</div>

Hi all, I’m on a PBS cluster where I cannot simply provide a machine file to julia. After a lot of trials, I found that only MPI transport works on the cluster, and I was able to adapt an MPIClusterManagers.jl example w…

---

## ["ERROR: LoadError: LoadError: UndefVarError: AbstractADType not defined" during GalacticOpim precompilation](https://discourse.julialang.org/t/error-loaderror-loaderror-undefvarerror-abstractadtype-not-defined-during-galacticopim-precompilation/48008)

<div class="topic-metadata">

**Author:** [@checco.jike](https://discourse.julialang.org/u/checco.jike)\
**Replies:** 8\
**Last updated:** [October 10, 2020, 5:56am UTC](https://discourse.julialang.org/t/error-loaderror-loaderror-undefvarerror-abstractadtype-not-defined-during-galacticopim-precompilation/48008 "2020-10-10T05:56:23Z")

</div>

I tried using this example found here: https://github.com/SciML/NeuralPDE.jl but I get the error “ERROR: LoadError: LoadError: UndefVarError: AbstractADType not defined” during the precompilation of the GalacticOptim pac…

---

## [Monads and monoids in julia](https://discourse.julialang.org/t/monads-and-monoids-in-julia/47745)

<div class="topic-metadata">

**Author:** [@bicepjai](https://discourse.julialang.org/u/bicepjai)\
**Replies:** 12\
**Last updated:** [October 10, 2020, 5:03am UTC](https://discourse.julialang.org/t/monads-and-monoids-in-julia/47745 "2020-10-10T05:03:43Z")

</div>

I am trying to get a grip on how to think in terms of functional programming concepts thru Scott Wlaschin’s videos and implement them in julia The Functional Toolkit - Scott Wlaschin - YouTube Functional programming de…

---

## [Change Array in Interpolation without recreating weights](https://discourse.julialang.org/t/change-array-in-interpolation-without-recreating-weights/48077)

<div class="topic-metadata">

**Author:** [@Sam\_Collie](https://discourse.julialang.org/u/Sam_Collie)\
**Replies:** 1\
**Last updated:** [October 10, 2020, 3:57am UTC](https://discourse.julialang.org/t/change-array-in-interpolation-without-recreating-weights/48077 "2020-10-10T03:57:19Z")

</div>

I’d like to change the Array of data within an interpolation without recreating a new instance of the interpolant. Here is a MWE: I am using the same nodes in each instance, so it seems there should be a performance gai…

---

## [Base.similar (and Zygote.Buffer) returning undefined instead of array of arrays](https://discourse.julialang.org/t/base-similar-and-zygote-buffer-returning-undefined-instead-of-array-of-arrays/48078)

<div class="topic-metadata">

**Author:** [@vaglino](https://discourse.julialang.org/u/vaglino)\
**Replies:** 1\
**Last updated:** [October 10, 2020, 3:04am UTC](https://discourse.julialang.org/t/base-similar-and-zygote-buffer-returning-undefined-instead-of-array-of-arrays/48078 "2020-10-10T03:04:12Z")

</div>

I am trying to initialize an array of arrays using similar and Zygote.buffer. If I initialize an array the functions work as expected, i.e. a = \[0., 0.\] similar(a) 2-element Array{Float64,1}: 7.229478454414514e221 2…

---

## [How to initialize an array of AbstractArray？](https://discourse.julialang.org/t/how-to-initialize-an-array-of-abstractarray/48022)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 8\
**Last updated:** [October 10, 2020, 2:39am UTC](https://discourse.julialang.org/t/how-to-initialize-an-array-of-abstractarray/48022 "2020-10-10T02:39:42Z")

</div>

How do I initialize a one-dimensional array, where each element of the array is a two-dimensional array? For example, I need to initialize a one-dimensional array of length three :\[\[0 0, 0 0\], \[0 0 0, 0 0 0\], \[0 0 0, 0 …

---

## [Overloaded function](https://discourse.julialang.org/t/overloaded-function/48085)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 2\
**Last updated:** [October 10, 2020, 2:38am UTC](https://discourse.julialang.org/t/overloaded-function/48085 "2020-10-10T02:38:17Z")

</div>

How to overload a function in Base function. For instance, how should I do the following: function abs(A::Array{Int64,2}) return abs.(A) end Error message: error in method definition: function Base.abs must be e…

---

## [Unique doesn't seem to obey == definitions](https://discourse.julialang.org/t/unique-doesnt-seem-to-obey-definitions/47455)

<div class="topic-metadata">

**Author:** [@pengwyn](https://discourse.julialang.org/u/pengwyn)\
**Replies:** 7\
**Last updated:** [October 10, 2020, 2:07am UTC](https://discourse.julialang.org/t/unique-doesnt-seem-to-obey-definitions/47455 "2020-10-10T02:07:22Z")

</div>

The behaviour for unique(itr) doesn’t seem to follow the documentation which specifies items are compared using an isequal check. This got me when I have a custom struct, e.g. mutable struct A x end Base.var"=="(one::A…

---

## [Easiest way to do Contour & 3D Plots of Semi-Discrete solution data?](https://discourse.julialang.org/t/easiest-way-to-do-contour-3d-plots-of-semi-discrete-solution-data/47115)

<div class="topic-metadata">

**Author:** [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Replies:** 6\
**Last updated:** [October 9, 2020, 11:45pm UTC](https://discourse.julialang.org/t/easiest-way-to-do-contour-3d-plots-of-semi-discrete-solution-data/47115 "2020-10-09T23:45:23Z")

</div>

Hi, I have a method-of-lines solution to a 2nd-order PDE, where the solution “sol” is discrete in x, has columns for discrete data points df/dt and f, and has an ODE-type solution which can be either discrete or continuo…

---

## [Enable logging after disabling logging](https://discourse.julialang.org/t/enable-logging-after-disabling-logging/48073)

<div class="topic-metadata">

**Author:** [@ranjan](https://discourse.julialang.org/u/ranjan)\
**Replies:** 0\
**Last updated:** [October 9, 2020, 10:55pm UTC](https://discourse.julialang.org/t/enable-logging-after-disabling-logging/48073 "2020-10-09T22:55:43Z")

</div>

I’m trying to enable global logging after disabling it. Is this the right/recommended way to do it? julia\> module A using Logging f() = @info("hi") end Main.A julia\> A.f() \[ Info: hi julia\>…

---

## [Using: include("file.jl") | Variables](https://discourse.julialang.org/t/using-include-file-jl-variables/48017)

<div class="topic-metadata">

**Author:** [@Jea](https://discourse.julialang.org/u/Jea)\
**Replies:** 2\
**Last updated:** [October 9, 2020, 7:31am UTC](https://discourse.julialang.org/t/using-include-file-jl-variables/48017 "2020-10-09T07:31:18Z")

</div>

How could the hi variable of second.jl be used in first.jl knowing that an include is made in second.jl over first.jl Example first.jl any = "$(hi)" # hi is undefined println() second.jl hi = "hola" # variable for u…

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

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