# General Usage

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

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

**Page:** 698

---

## [Plotting in pyplot: z coordinate always becomes zero when plotted using the scatter when xlims,ylims and zlims are given](https://discourse.julialang.org/t/plotting-in-pyplot-z-coordinate-always-becomes-zero-when-plotted-using-the-scatter-when-xlims-ylims-and-zlims-are-given/47255)

<div class="topic-metadata">

**Author:** [@manvibharat](https://discourse.julialang.org/u/manvibharat)\
**Replies:** 7\
**Last updated:** [September 26, 2020, 10:58am UTC](https://discourse.julialang.org/t/plotting-in-pyplot-z-coordinate-always-becomes-zero-when-plotted-using-the-scatter-when-xlims-ylims-and-zlims-are-given/47255 "2020-09-26T10:58:12Z")

</div>

The package used is pyplot: using Plots; pyplot() This plot scatter3d(\[0\],\[1\],\[100\], xlims=(-100,100),ylims=(-100,100), zlims=(-100,100),c=:red,markersize=5) and also this plot scatter3d(\[0\],\[1\],\[100\], xlims=(-100,1…

---

## [@generated inside macro: who's interpolating?](https://discourse.julialang.org/t/generated-inside-macro-whos-interpolating/46895)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 13\
**Last updated:** [September 26, 2020, 4:34am UTC](https://discourse.julialang.org/t/generated-inside-macro-whos-interpolating/46895 "2020-09-26T04:34:06Z")

</div>

I have a macro to generate code for “many” binary operations. The macro generates several functions, including a @generated function so that I can generate code for any combination of subtypes. A crash reproduction of …

---

## [Searching for similar text records. What tools?](https://discourse.julialang.org/t/searching-for-similar-text-records-what-tools/47300)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 0\
**Last updated:** [September 26, 2020, 6:30am UTC](https://discourse.julialang.org/t/searching-for-similar-text-records-what-tools/47300 "2020-09-26T06:30:21Z")

</div>

What tools do you recommend for searching for similar text records. The database of companies is multiplied by manual mistakes, zip code, street name, etc. … Of course I already use String Distances. Any other tools? P…

---

## [Type inference for nested iterators](https://discourse.julialang.org/t/type-inference-for-nested-iterators/47082)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 16\
**Last updated:** [September 25, 2020, 9:16pm UTC](https://discourse.julialang.org/t/type-inference-for-nested-iterators/47082 "2020-09-25T21:16:36Z")

</div>

In this thread, I wrote this function: using Base.Iterators function foo(itr, n, fillvalue) ntake = ceil(Int, length(itr)/n) extended\_itr = flatten( ( itr, repeated(fillvalue) ) ) take(partition(extended\_it…

---

## [Dropmissing!() on a dataframe causes segfault](https://discourse.julialang.org/t/dropmissing-on-a-dataframe-causes-segfault/47101)

<div class="topic-metadata">

**Author:** [@scone](https://discourse.julialang.org/u/scone)\
**Replies:** 8\
**Last updated:** [September 25, 2020, 7:35pm UTC](https://discourse.julialang.org/t/dropmissing-on-a-dataframe-causes-segfault/47101 "2020-09-25T19:35:23Z")

</div>

I have code that was working just a week ago, and now when I get to the line with dropmissing!(df), I get this: MethodError: Cannot \`convert\` an object of type Missing to an object of type Float64 Closest candidates are…

---

## [Help generating an Expression](https://discourse.julialang.org/t/help-generating-an-expression/47283)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 3\
**Last updated:** [September 25, 2020, 7:34pm UTC](https://discourse.julialang.org/t/help-generating-an-expression/47283 "2020-09-25T19:34:09Z")

</div>

I have some wide-formatted data that I need to group and summarize. A MWE is below: using DataFramesMeta df = DataFrame( id = repeat(1:5, inner=3), a\_1 = rand(15), a\_2 = rand(15), a\_3 = rand(15), b\_…

---

## [DiffEqFlux.sciml\_train is slow](https://discourse.julialang.org/t/diffeqflux-sciml-train-is-slow/47155)

<div class="topic-metadata">

**Author:** [@checco.jike](https://discourse.julialang.org/u/checco.jike)\
**Replies:** 5\
**Last updated:** [September 25, 2020, 7:28pm UTC](https://discourse.julialang.org/t/diffeqflux-sciml-train-is-slow/47155 "2020-09-25T19:28:18Z")

</div>

Hi all! I’m trying to train the Universal Differential Equations learning with DiffEqFlux.sciml\_train Here is the code relative to the 1D problem: https://github.com/ChrisRackauckas/universal\_differential\_equations/blo…

---

## [Flux & Plots](https://discourse.julialang.org/t/flux-plots/30107)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 5\
**Last updated:** [September 25, 2020, 3:59pm UTC](https://discourse.julialang.org/t/flux-plots/30107 "2020-09-25T15:59:55Z")

</div>

Overview I have good experience with Flux in the past, but now have problems with fitting a 2-input, 1-output data set: the result is rather different from what I get with linear regression. Also, I struggle with doing …

---

## [Weird allocations](https://discourse.julialang.org/t/weird-allocations/47267)

<div class="topic-metadata">

**Author:** [@mikkoku](https://discourse.julialang.org/u/mikkoku)\
**Replies:** 2\
**Last updated:** [September 25, 2020, 2:55pm UTC](https://discourse.julialang.org/t/weird-allocations/47267 "2020-09-25T14:55:27Z")

</div>

I was working some numeric integration stuff when I encountered a lot of small allocations for which I couldn’t find a source for. Here is a MWE demonstrating the behaviour function f1(f, x) s = 0.0 for i in 1:…

---

## [Flipping Bits in a Sparse Matrix- Expanding stored entries](https://discourse.julialang.org/t/flipping-bits-in-a-sparse-matrix-expanding-stored-entries/47265)

<div class="topic-metadata">

**Author:** [@Phillip\_Sutton](https://discourse.julialang.org/u/Phillip_Sutton)\
**Replies:** 2\
**Last updated:** [September 25, 2020, 2:38pm UTC](https://discourse.julialang.org/t/flipping-bits-in-a-sparse-matrix-expanding-stored-entries/47265 "2020-09-25T14:38:26Z")

</div>

My sparse bit array is not dropping non zeros when flipping bits between rows (assignment optimization problem) 8766×11125 SparseArrays.SparseMatrixCSC{Bool,Int64} with 8766 stored entries: \[7244, 1\] = 1 \[2111,…

---

## [Yet another function/loop scope question](https://discourse.julialang.org/t/yet-another-function-loop-scope-question/47241)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 5\
**Last updated:** [September 25, 2020, 1:15pm UTC](https://discourse.julialang.org/t/yet-another-function-loop-scope-question/47241 "2020-09-25T13:15:54Z")

</div>

Thanks for your patience with such a simple question, but I’m stumped. In a function, I want to: Declare a vector of vectors Iterate through two loops and update the original vector of vectors Return the vector of vect…

---

## [Why does changing this indexing slows the code so much?](https://discourse.julialang.org/t/why-does-changing-this-indexing-slows-the-code-so-much/47246)

<div class="topic-metadata">

**Author:** [@disberd](https://discourse.julialang.org/u/disberd)\
**Replies:** 5\
**Last updated:** [September 25, 2020, 12:30pm UTC](https://discourse.julialang.org/t/why-does-changing-this-indexing-slows-the-code-so-much/47246 "2020-09-25T12:30:28Z")

</div>

Hi, I was trying to play around with the implementation of fsortperm in SortingLab.jl and wanted to try making an implementation to just compute directly the sorted indices rather than sorting both the values vector and…

---

## [Why can't I generate a function with multiple arguments using Symbol("arg1,arg2")?](https://discourse.julialang.org/t/why-cant-i-generate-a-function-with-multiple-arguments-using-symbol-arg1-arg2/47254)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 5\
**Last updated:** [September 25, 2020, 12:05pm UTC](https://discourse.julialang.org/t/why-cant-i-generate-a-function-with-multiple-arguments-using-symbol-arg1-arg2/47254 "2020-09-25T12:05:53Z")

</div>

I’m not sure what’s going on here, and I’m not sure if this is a valid use of Symbols either. julia\> for TA in \[Symbol("a,b")\] @eval f($TA) = a + b end julia\> methods(f) # 1 method for generic function "f…

---

## [I have doubts about using Pots.jl](https://discourse.julialang.org/t/i-have-doubts-about-using-pots-jl/47252)

<div class="topic-metadata">

**Author:** [@adeil](https://discourse.julialang.org/u/adeil)\
**Replies:** 7\
**Last updated:** [September 25, 2020, 10:41am UTC](https://discourse.julialang.org/t/i-have-doubts-about-using-pots-jl/47252 "2020-09-25T10:41:31Z")

</div>

I’m trying to plot this function x = 0.2 \* cos (2 \* t + π) but there is something wrong with the definition of t. " using Pkg Pkg.add(“Plots”) using Plots t=range(0,stop=10, length=100) #0:0.01:2π y = 0.2cos.(2\*t…

---

## [Why is this code run-time dispatch/slow?](https://discourse.julialang.org/t/why-is-this-code-run-time-dispatch-slow/47178)

<div class="topic-metadata">

**Author:** [@JamesK](https://discourse.julialang.org/u/JamesK)\
**Replies:** 16\
**Last updated:** [September 25, 2020, 10:34am UTC](https://discourse.julialang.org/t/why-is-this-code-run-time-dispatch-slow/47178 "2020-09-25T10:34:29Z")

</div>

I made a minimum reproducible example for a performance issue I am having with my code: mutable struct Array\_container array\_field::Array{Float64} end function foo(a::Array\_container, b::Array\_container) a.arra…

---

## [Understanding and avoiding allocations with StructArrays](https://discourse.julialang.org/t/understanding-and-avoiding-allocations-with-structarrays/46880)

<div class="topic-metadata">

**Author:** [@touste](https://discourse.julialang.org/u/touste)\
**Replies:** 16\
**Last updated:** [September 25, 2020, 9:42am UTC](https://discourse.julialang.org/t/understanding-and-avoiding-allocations-with-structarrays/46880 "2020-09-25T09:42:15Z")

</div>

Hi all, I’m working on a piece of code where I have triangles which are made of points. Each point has a number of properties such as position, velocity, force… In some part of the code I need to calculate the force fo…

---

## [How to convert an array to a dataframe?](https://discourse.julialang.org/t/how-to-convert-an-array-to-a-dataframe/47233)

<div class="topic-metadata">

**Author:** [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Replies:** 2\
**Last updated:** [September 25, 2020, 7:05am UTC](https://discourse.julialang.org/t/how-to-convert-an-array-to-a-dataframe/47233 "2020-09-25T07:05:48Z")

</div>

column = rand(Int64, 10) DataFrame(column, \[:col1\]) This gives: ERROR: ArgumentError: columns argument must be a vector of AbstractVector objects

---

## [Why my plot looks weired and different from others'?](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536)

<div class="topic-metadata">

**Author:** [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Replies:** 15\
**Last updated:** [September 24, 2020, 10:19pm UTC](https://discourse.julialang.org/t/why-my-plot-looks-weired-and-different-from-others/39536 "2020-09-24T22:19:12Z")

</div>

I used the code from Quantecon to create a plot. It looks weird with thick lines and its background. I guess the issue is with my computer because both Jupyter notebook and Juno gave the same result.

---

## [Global / local scope warnings in 1.5](https://discourse.julialang.org/t/global-local-scope-warnings-in-1-5/44566)

<div class="topic-metadata">

**Author:** [@willtebbutt](https://discourse.julialang.org/u/willtebbutt)\
**Replies:** 4\
**Last updated:** [September 24, 2020, 4:04pm UTC](https://discourse.julialang.org/t/global-local-scope-warnings-in-1-5/44566 "2020-09-24T16:04:19Z")

</div>

As of 1.5 I’m getting the new warning about global / local scope: ┌ Warning: Assignment to \`#s262\` in soft scope is ambiguous because a global variable by the same name exists: \`#s262\` will be treated as a new local. Di…

---

## [Is there a way to "grep" inside REPL?](https://discourse.julialang.org/t/is-there-a-way-to-grep-inside-repl/47216)

<div class="topic-metadata">

**Author:** [@HiroIshida](https://discourse.julialang.org/u/HiroIshida)\
**Replies:** 2\
**Last updated:** [September 24, 2020, 3:31pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-grep-inside-repl/47216 "2020-09-24T15:31:46Z")

</div>

Inside the REPL, for example, when I do methods(HomogenousMesh) from GeometryTypes.jl, I will get the following list of many signatures: julia\> methods(HomogenousMesh) # 15 methods for type constructor: \[1\] (::Type{Homo…

---

## [List comprehension in Zygote](https://discourse.julialang.org/t/list-comprehension-in-zygote/41881)

<div class="topic-metadata">

**Author:** [@rlrs](https://discourse.julialang.org/u/rlrs)\
**Replies:** 8\
**Last updated:** [September 24, 2020, 2:25pm UTC](https://discourse.julialang.org/t/list-comprehension-in-zygote/41881 "2020-09-24T14:25:46Z")

</div>

I’m trying to do something like this, (I hope the snippet is enough although it’s incomplete) prob\_primitives = \[(θ\[i+1\], p) for (i, p) in enumerate(primitives)\] where primitives is a Vector. However, using this code i…

---

## [Errors when updating packages](https://discourse.julialang.org/t/errors-when-updating-packages/47199)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 1\
**Last updated:** [September 24, 2020, 2:22pm UTC](https://discourse.julialang.org/t/errors-when-updating-packages/47199 "2020-09-24T14:22:38Z")

</div>

Even after removing Turing package, I keep receiving this error messages when I try to update after installing Julia 1.5.2 on my MacBook 10.15.6: (@v1.5) pkg\> up Updating registry at \`~/.julia/registries/General\` …

---

## [Recover status of a package from julia](https://discourse.julialang.org/t/recover-status-of-a-package-from-julia/47197)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 6\
**Last updated:** [September 24, 2020, 11:57am UTC](https://discourse.julialang.org/t/recover-status-of-a-package-from-julia/47197 "2020-09-24T11:57:59Z")

</div>

Hi, I would like to recover a string containing the status of a given package (v.2.2.2 in the example) but I am only able to print it out julia\> Pkg.status("CuArrays") Project BTL v0.1.0 Status \`~/Project/BTL.jl/Projec…

---

## [How to test private / non-exported methods of a module?](https://discourse.julialang.org/t/how-to-test-private-non-exported-methods-of-a-module/47201)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 1\
**Last updated:** [September 24, 2020, 11:09am UTC](https://discourse.julialang.org/t/how-to-test-private-non-exported-methods-of-a-module/47201 "2020-09-24T11:09:42Z")

</div>

When writing a module, I would like to test the methods as I code them up, but how do I test the methods that are not exported?

---

## [Map(my\_fun, Array Array) What wrong?](https://discourse.julialang.org/t/map-my-fun-array-array-what-wrong/47183)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 4\
**Last updated:** [September 24, 2020, 9:15am UTC](https://discourse.julialang.org/t/map-my-fun-array-array-what-wrong/47183 "2020-09-24T09:15:41Z")

</div>

using StringDistances function CLD(a,b) result=fill(0.0,size(b,1)) for p=1:size(a,1) result\[p\]=compare(a\[p,:\]\[\],b\[p,:\]\[\],DamerauLevenshtein()) end return result end A=rand(5,3); B=rand(5,3) julia\> CLD(A\[1,:\],B\[1,:\]) 3-el…

---

## [External program with string argument interpolation](https://discourse.julialang.org/t/external-program-with-string-argument-interpolation/47134)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 8\
**Last updated:** [September 24, 2020, 7:40am UTC](https://discourse.julialang.org/t/external-program-with-string-argument-interpolation/47134 "2020-09-24T07:40:48Z")

</div>

Hi, I can’t figure how (after reading https://docs.julialang.org/en/v1/manual/running-external-programs/manual) to run a command with string arguments enclosed with “” Le’s say the shell command I want to invoke is s…

---

## [Package Parameters, mutable struct as function argument](https://discourse.julialang.org/t/package-parameters-mutable-struct-as-function-argument/47175)

<div class="topic-metadata">

**Author:** [@cricci](https://discourse.julialang.org/u/cricci)\
**Replies:** 3\
**Last updated:** [September 24, 2020, 6:21am UTC](https://discourse.julialang.org/t/package-parameters-mutable-struct-as-function-argument/47175 "2020-09-24T06:21:44Z")

</div>

I am using the Parameters package to do some work. One of the parameters is an array and surprisingly the struct gets changed when I give it as an argument to a function that modify the array after unpacking using Param…

---

## [Performance Help on Large Matrix Manipulation](https://discourse.julialang.org/t/performance-help-on-large-matrix-manipulation/47029)

<div class="topic-metadata">

**Author:** [@jleman](https://discourse.julialang.org/u/jleman)\
**Replies:** 16\
**Last updated:** [September 24, 2020, 6:08am UTC](https://discourse.julialang.org/t/performance-help-on-large-matrix-manipulation/47029 "2020-09-24T06:08:35Z")

</div>

I have a large array of matricies and need to apply inverse FFT as shown in the attached diagram. I do this by restructuring the data using getindex . After completing the inverse FFT I then recreating the original matr…

---

## [Listing all the ways to make cross-platform desktop apps](https://discourse.julialang.org/t/listing-all-the-ways-to-make-cross-platform-desktop-apps/47168)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 0\
**Last updated:** [September 24, 2020, 2:21am UTC](https://discourse.julialang.org/t/listing-all-the-ways-to-make-cross-platform-desktop-apps/47168 "2020-09-24T02:21:28Z")

</div>

I was a bit bewildered by all ways one can approach making desktop apps. So I’ve collected all the one I know of. Any additions? Any additional comments? See https://github.com/xiaodaigh/awesome-julia-desktop-app-makers…

---

## [Is there a better way to do this? many calculated columns](https://discourse.julialang.org/t/is-there-a-better-way-to-do-this-many-calculated-columns/47111)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 6\
**Last updated:** [September 24, 2020, 12:40am UTC](https://discourse.julialang.org/t/is-there-a-better-way-to-do-this-many-calculated-columns/47111 "2020-09-24T00:40:27Z")

</div>

Creating a DataFrame with a large number of calculated columns. To make the logic as clear as possible, avoiding the vectorised operators and instead putting all logic within an eachrow loop. new\_DF = DataFrame() for …

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

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