# General Usage

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

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

**Page:** 652

---

## [Why this happens on Windows:\`\`\`julia&gt; run(\`echo hello\`)ERROR: IOError: could](https://discourse.julialang.org/t/why-this-happens-on-windows-julia-gt-run-echo-hello-error-ioerror-could/54209)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [January 29, 2021, 6:49pm UTC](https://discourse.julialang.org/t/why-this-happens-on-windows-julia-gt-run-echo-hello-error-ioerror-could/54209 "2021-01-29T18:49:35Z")

</div>

Why this happens on Windows: julia&gt; run(\`echo hello\`) ERROR: IOError: could not spawn \`echo hello\`: no such file or directory (ENOENT) (Original message :slack:)

---

## [I have a DataFrame with multiple columns of type Union{Missing, String}. What is the most concise manner of converting the non-missing values in Float?](https://discourse.julialang.org/t/i-have-a-dataframe-with-multiple-columns-of-type-union-missing-string-what-is-the-most-concise-manner-of-converting-the-non-missing-values-in-float/54205)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [January 29, 2021, 6:44pm UTC](https://discourse.julialang.org/t/i-have-a-dataframe-with-multiple-columns-of-type-union-missing-string-what-is-the-most-concise-manner-of-converting-the-non-missing-values-in-float/54205 "2021-01-29T18:44:03Z")

</div>

Hi! I have a DataFrame with multiple columns of type Union{Missing, String}. What is the most concise manner of converting the non-missing values in Float? (Original message :slack:)

---

## [Is it possible to delete a row or column from a multi-dimensional array in-place?](https://discourse.julialang.org/t/is-it-possible-to-delete-a-row-or-column-from-a-multi-dimensional-array-in-place/54182)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 4\
**Last updated:** [January 29, 2021, 6:23pm UTC](https://discourse.julialang.org/t/is-it-possible-to-delete-a-row-or-column-from-a-multi-dimensional-array-in-place/54182 "2021-01-29T18:23:29Z")

</div>

Hey guys, is it possible to delete a row or column from a multi-dimensional array (say a matrix) “in-place”? Somewhat similar to what deleteat! does for vectors. I guess the answer is no but I thought I’d ask (and test o…

---

## [Hello got a quick question.. I am using \`walkdir\` to scan the file system for file](https://discourse.julialang.org/t/hello-got-a-quick-question-i-am-using-walkdir-to-scan-the-file-system-for-file/54194)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [January 29, 2021, 5:07pm UTC](https://discourse.julialang.org/t/hello-got-a-quick-question-i-am-using-walkdir-to-scan-the-file-system-for-file/54194 "2021-01-29T17:07:46Z")

</div>

I am using walkdir to scan the file system for files. I am running into an error where everything craps the bed at the first sign of a file that has too high of permissions. I see that walkdir accepts onerror=throws. Wha…

---

## [How to plot mnist of kaggle data?](https://discourse.julialang.org/t/how-to-plot-mnist-of-kaggle-data/54188)

<div class="topic-metadata">

**Author:** [@Ravinder\_Ram](https://discourse.julialang.org/u/Ravinder_Ram)\
**Replies:** 0\
**Last updated:** [January 29, 2021, 3:27pm UTC](https://discourse.julialang.org/t/how-to-plot-mnist-of-kaggle-data/54188 "2021-01-29T15:27:49Z")

</div>

whenever i try to plot mnist dataset it plot tilt… why? 28 \* 28 pixel I’m reshape here my code link https://drive.google.com/file/d/1qH4rKO3LbgB4L1lMqHBBr4NmTXurDV2B/view?usp=sharing

---

## [Overloading \`Base.getproperty\` performance](https://discourse.julialang.org/t/overloading-base-getproperty-performance/54178)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 2\
**Last updated:** [January 29, 2021, 12:23pm UTC](https://discourse.julialang.org/t/overloading-base-getproperty-performance/54178 "2021-01-29T12:23:05Z")

</div>

Inspired by this post I wanted to add extra properties to my type, but noted a significant performance hit: julia\> using BenchmarkTools julia\> struct AType{T} data::T end julia\> struct BType{T} …

---

## [Different Results When Saving Plots as png or pdf](https://discourse.julialang.org/t/different-results-when-saving-plots-as-png-or-pdf/54169)

<div class="topic-metadata">

**Author:** [@fermion4](https://discourse.julialang.org/u/fermion4)\
**Replies:** 2\
**Last updated:** [January 29, 2021, 12:06pm UTC](https://discourse.julialang.org/t/different-results-when-saving-plots-as-png-or-pdf/54169 "2021-01-29T12:06:23Z")

</div>

I try to save my plots as pdf files for a publication. Before I used the png file format and everything worked as expected, as seen in the first figure. But when I use the same code and save my plots as a pdf or svg, fo…

---

## [What is the best workflow when juggling with many modules and files?](https://discourse.julialang.org/t/what-is-the-best-workflow-when-juggling-with-many-modules-and-files/54067)

<div class="topic-metadata">

**Author:** [@agatheLG](https://discourse.julialang.org/u/agatheLG)\
**Replies:** 13\
**Last updated:** [January 29, 2021, 11:50am UTC](https://discourse.julialang.org/t/what-is-the-best-workflow-when-juggling-with-many-modules-and-files/54067 "2021-01-29T11:50:09Z")

</div>

Hi, I’m a bit unsure about what would be the best way to import a module with using. I understand, looking throught past julia topics, that if you want to import a local module, let’s say Users.jl, you should do include(…

---

## [Vscode and Julia 1.5.3 - stetup](https://discourse.julialang.org/t/vscode-and-julia-1-5-3-stetup/54168)

<div class="topic-metadata">

**Author:** [@Peter-Jolly](https://discourse.julialang.org/u/Peter-Jolly)\
**Replies:** 5\
**Last updated:** [January 29, 2021, 11:17am UTC](https://discourse.julialang.org/t/vscode-and-julia-1-5-3-stetup/54168 "2021-01-29T11:17:41Z")

</div>

I am having a difficult time to get Vscode to work with Julia 1.5.3 after I upgraded from Julia 1.5.2. I am sure it is due to my settings but I cannot find examples of how to fix. When I start Vscode now I cannot run any…

---

## [Debugger with CSV read](https://discourse.julialang.org/t/debugger-with-csv-read/54172)

<div class="topic-metadata">

**Author:** [@LinasBa](https://discourse.julialang.org/u/LinasBa)\
**Replies:** 0\
**Last updated:** [January 29, 2021, 10:25am UTC](https://discourse.julialang.org/t/debugger-with-csv-read/54172 "2021-01-29T10:25:22Z")

</div>

Can’t debug code calling CSV.read, without debugging it runs fine. using CSV, DataFrames function main() df = CSV.read("outputs/test.csv", DataFrame; header=false) println(df) end julia\> include("test.jl") mai…

---

## [Simple question lightgraphs and matrix representation](https://discourse.julialang.org/t/simple-question-lightgraphs-and-matrix-representation/54104)

<div class="topic-metadata">

**Author:** [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)\
**Replies:** 5\
**Last updated:** [January 29, 2021, 3:16am UTC](https://discourse.julialang.org/t/simple-question-lightgraphs-and-matrix-representation/54104 "2021-01-29T03:16:52Z")

</div>

hi, T8 = star\_graph(8) how do I use the LinAlg module to get the adjacency matrix of this graph? best,

---

## [Multithreading on Cartesian products](https://discourse.julialang.org/t/multithreading-on-cartesian-products/54009)

<div class="topic-metadata">

**Author:** [@gregory](https://discourse.julialang.org/u/gregory)\
**Replies:** 22\
**Last updated:** [January 28, 2021, 9:43pm UTC](https://discourse.julialang.org/t/multithreading-on-cartesian-products/54009 "2021-01-28T21:43:20Z")

</div>

Suppose I have an array of 5 coordinates each ranging from (1:5) so that myarr = \[1:5 for i in 1 : 5\] is of length 3125 (in reality this list can be much larger and each element could range over different values). I am …

---

## [The case of disappearing double dash](https://discourse.julialang.org/t/the-case-of-disappearing-double-dash/54126)

<div class="topic-metadata">

**Author:** [@matklad](https://discourse.julialang.org/u/matklad)\
**Replies:** 2\
**Last updated:** [January 28, 2021, 4:27pm UTC](https://discourse.julialang.org/t/the-case-of-disappearing-double-dash/54126 "2021-01-28T16:27:42Z")

</div>

I have the following julia script: #!/usr/bin/env julia println(ARGS) Heres’s the output if I run it with an -- argument: 18:41:14|~/tmp λ ./main.jl -a --b -- c \["-a", "--b", "c"\] What happened to --? Just in case, …

---

## [Passing constant configuration values to modules](https://discourse.julialang.org/t/passing-constant-configuration-values-to-modules/28551)

<div class="topic-metadata">

**Author:** [@aahaselgrove](https://discourse.julialang.org/u/aahaselgrove)\
**Replies:** 7\
**Last updated:** [January 28, 2021, 3:33pm UTC](https://discourse.julialang.org/t/passing-constant-configuration-values-to-modules/28551 "2021-01-28T15:33:25Z")

</div>

I am working on a numerical optimisation project with Julia in a Jupyter notebook. My current workflow is to define the problem size with some global constants at the top of the notebook (eg. const N = 20), which are the…

---

## [Defining a custom constructor for a type alias?](https://discourse.julialang.org/t/defining-a-custom-constructor-for-a-type-alias/54017)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 8\
**Last updated:** [January 28, 2021, 2:46pm UTC](https://discourse.julialang.org/t/defining-a-custom-constructor-for-a-type-alias/54017 "2021-01-28T14:46:51Z")

</div>

This snippet is invalid: boo = Array{Stuff,1} function boo(x,y,z) someStuff = ..... return someStuff end It returns this error: cannot define function boo; it already has a value Would you have any idea ab…

---

## [Empty result when comparing incompatible types](https://discourse.julialang.org/t/empty-result-when-comparing-incompatible-types/54102)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 2\
**Last updated:** [January 28, 2021, 1:23pm UTC](https://discourse.julialang.org/t/empty-result-when-comparing-incompatible-types/54102 "2021-01-28T13:23:48Z")

</div>

Often I am filtering a vector or joining dataframes and I use the wrong type and get an empty result. For example with Base: rows = \[ (month = 01, x = 15.4), (month = 02, x = 38.3), \] filter(x-\>x.month == "January", …

---

## [Help me in using Plots Pkg, scatter](https://discourse.julialang.org/t/help-me-in-using-plots-pkg-scatter/54115)

<div class="topic-metadata">

**Author:** [@Mahnazi](https://discourse.julialang.org/u/Mahnazi)\
**Replies:** 1\
**Last updated:** [January 28, 2021, 1:18pm UTC](https://discourse.julialang.org/t/help-me-in-using-plots-pkg-scatter/54115 "2021-01-28T13:18:08Z")

</div>

using XLSX using Plots Data = XLSX.readxlsx(“VRPTW.xlsx”) Xd=Data\[“C101!E3:E28”\] Yd=Data\[“C101!F3:F28”\] #Display the data scatter(Xd,Yd) but Cannot convert Array{Any,2} to series data for plotting error(::String…

---

## [Calling Julia functions from a multi-threading scheduler written in C?](https://discourse.julialang.org/t/calling-julia-functions-from-a-multi-threading-scheduler-written-in-c/54114)

<div class="topic-metadata">

**Author:** [@stustd](https://discourse.julialang.org/u/stustd)\
**Replies:** 1\
**Last updated:** [January 28, 2021, 1:16pm UTC](https://discourse.julialang.org/t/calling-julia-functions-from-a-multi-threading-scheduler-written-in-c/54114 "2021-01-28T13:16:18Z")

</div>

I have a scheduler written in C that repetitively executes batches if C functions in multi-threaded fashion: Mutually exclusive groups of C functions update one reactor state (i.e. the total set of C functions is parti…

---

## [Scope of dictionary-generated variables](https://discourse.julialang.org/t/scope-of-dictionary-generated-variables/54072)

<div class="topic-metadata">

**Author:** [@vavrines](https://discourse.julialang.org/u/vavrines)\
**Replies:** 10\
**Last updated:** [January 28, 2021, 8:05am UTC](https://discourse.julialang.org/t/scope-of-dictionary-generated-variables/54072 "2021-01-28T08:05:47Z")

</div>

Saying I’d like to create variables from a dictionary. With the following codes, I found the former generated variables aren’t deliminated after each run of the function. D1 = Dict("a" =\> 1, "b" =\> 2) D2 = Dict("a" =\> …

---

## [Unable to compute gradient of loss of my model with sciml\_train](https://discourse.julialang.org/t/unable-to-compute-gradient-of-loss-of-my-model-with-sciml-train/49572)

<div class="topic-metadata">

**Author:** [@TomCif](https://discourse.julialang.org/u/TomCif)\
**Replies:** 5\
**Last updated:** [January 28, 2021, 6:38am UTC](https://discourse.julialang.org/t/unable-to-compute-gradient-of-loss-of-my-model-with-sciml-train/49572 "2021-01-28T06:38:36Z")

</div>

Hello, I’m facing an error for which I can’t find any solution or reporting. I’m trying to train a model defined by an ODE for which i solve the adjoint problem using concrete\_solve. function initial\_value\_problem(du:…

---

## [Permutation of n arrays](https://discourse.julialang.org/t/permutation-of-n-arrays/54098)

<div class="topic-metadata">

**Author:** [@trathi](https://discourse.julialang.org/u/trathi)\
**Replies:** 6\
**Last updated:** [January 28, 2021, 6:26am UTC](https://discourse.julialang.org/t/permutation-of-n-arrays/54098 "2021-01-28T06:26:34Z")

</div>

I have n array of arrays and I want to generate a single array containing all permutations of these arrays. For example (with 2 arrays): a=\[\[1,2,3\],\[4,5,6\]\] b=\[\[7,8,9\],\[10,11,12\]\] c=\[\[\[1,2,3\],\[7,8,9\]\],\[\[1,2,3\],\[10,11,12…

---

## [Generating Structs at Runtime; Tips and Tricks?](https://discourse.julialang.org/t/generating-structs-at-runtime-tips-and-tricks/54096)

<div class="topic-metadata">

**Author:** [@olynch](https://discourse.julialang.org/u/olynch)\
**Replies:** 3\
**Last updated:** [January 28, 2021, 3:35am UTC](https://discourse.julialang.org/t/generating-structs-at-runtime-tips-and-tricks/54096 "2021-01-28T03:35:25Z")

</div>

Hello all, For various reasons, I would like to write a macro that evals code at runtime to construct a custom struct. The problem is that the code that I am evaling is not hygenically generated, because it comes out of…

---

## [When can a single-call optimization be used?](https://discourse.julialang.org/t/when-can-a-single-call-optimization-be-used/54089)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 3\
**Last updated:** [January 28, 2021, 12:35am UTC](https://discourse.julialang.org/t/when-can-a-single-call-optimization-be-used/54089 "2021-01-28T00:35:46Z")

</div>

function func(x) sum(x) / sum(x) end xs = rand(0:.1:1, 1000) @code\_typed func(xs) julia\> @code\_typed func(xs) CodeInfo( 1 ── %1 = Base.identity::typeof(identity) │ %2 = Base.add\_sum::typeof(Base.add\_sum) │ …

---

## [Writing a macro for manual @spawn control](https://discourse.julialang.org/t/writing-a-macro-for-manual-spawn-control/54074)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 0\
**Last updated:** [January 27, 2021, 8:16pm UTC](https://discourse.julialang.org/t/writing-a-macro-for-manual-spawn-control/54074 "2021-01-27T20:16:10Z")

</div>

In some situations we need to limit the number of simultaneously running tasks, for example, when you @spawn run(...), Julia won’t know about CPU usage resulting an over-spawn. I find something like this helpful: julia\>…

---

## [Why wouldn't use tuples for computation?](https://discourse.julialang.org/t/why-wouldnt-use-tuples-for-computation/54060)

<div class="topic-metadata">

**Author:** [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Replies:** 6\
**Last updated:** [January 27, 2021, 5:29pm UTC](https://discourse.julialang.org/t/why-wouldnt-use-tuples-for-computation/54060 "2021-01-27T17:29:07Z")

</div>

I was reading this Github page, and came across a post from StefanKarpinski, and he says: …but you really mostly shouldn’t be doing much computation with tuples in the first place,… I was wondering if someone could e…

---

## [Filling non-contiguous slices of an array with the real and imaginary part of another](https://discourse.julialang.org/t/filling-non-contiguous-slices-of-an-array-with-the-real-and-imaginary-part-of-another/54033)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 3\
**Last updated:** [January 27, 2021, 5:07pm UTC](https://discourse.julialang.org/t/filling-non-contiguous-slices-of-an-array-with-the-real-and-imaginary-part-of-another/54033 "2021-01-27T17:07:53Z")

</div>

Hello, I would like to get your feedback on the fastest way to fill the 1 modulo 3 entries with the real part of an array and the 2 modul0 3 entries with the imaginary part of the same array. using BenchmarkTools A = r…

---

## [Remove elements with matching string values in tuple](https://discourse.julialang.org/t/remove-elements-with-matching-string-values-in-tuple/54065)

<div class="topic-metadata">

**Author:** [@lorb24](https://discourse.julialang.org/u/lorb24)\
**Replies:** 1\
**Last updated:** [January 27, 2021, 5:00pm UTC](https://discourse.julialang.org/t/remove-elements-with-matching-string-values-in-tuple/54065 "2021-01-27T17:00:09Z")

</div>

I have a list called list1: \[a,b,c\] And use the function function combos(list1,list2) combolist=vec(collect(Base.product(list1,list2))) return combolist end And my results look something like below: (a,a) (a…

---

## [Package Manager won't load in Pluto](https://discourse.julialang.org/t/package-manager-wont-load-in-pluto/54066)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 0\
**Last updated:** [January 27, 2021, 4:55pm UTC](https://discourse.julialang.org/t/package-manager-wont-load-in-pluto/54066 "2021-01-27T16:55:34Z")

</div>

In Pluto everything runs until begin import Pkg Pkg.activate(mktempdir()) end then this keeps trying to load, but never loads or gives an error message.

---

## [Does eigen( ) get stuck in processing of the results?](https://discourse.julialang.org/t/does-eigen-get-stuck-in-processing-of-the-results/53917)

<div class="topic-metadata">

**Author:** [@Erik](https://discourse.julialang.org/u/Erik)\
**Replies:** 10\
**Last updated:** [January 27, 2021, 3:56pm UTC](https://discourse.julialang.org/t/does-eigen-get-stuck-in-processing-of-the-results/53917 "2021-01-27T15:56:16Z")

</div>

I wrote the below code (originally in MATLAB, ported to Julia). Unfortunately, the code runs at pretty much the same speed as the MATLAB original. using LinearAlgebra using StaticArrays using DelimitedFiles using Benchm…

---

## [Creating a matrix as Symmetric causes excessive allocations in multithreaded loop](https://discourse.julialang.org/t/creating-a-matrix-as-symmetric-causes-excessive-allocations-in-multithreaded-loop/54059)

<div class="topic-metadata">

**Author:** [@pedrohnv](https://discourse.julialang.org/u/pedrohnv)\
**Replies:** 2\
**Last updated:** [January 27, 2021, 3:36pm UTC](https://discourse.julialang.org/t/creating-a-matrix-as-symmetric-causes-excessive-allocations-in-multithreaded-loop/54059 "2021-01-27T15:36:37Z")

</div>

In the following code snippet, I use a symmetric matrix to calculate another. If I assign the matrix as Symmetric, it leads to excessive allocations if the loop is multi-threaded. using BenchmarkTools function foo() …

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

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