# General Usage

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

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

**Page:** 480

---

## [What is the closest thing to Tidymodels in Julia?](https://discourse.julialang.org/t/what-is-the-closest-thing-to-tidymodels-in-julia/77026)

<div class="topic-metadata">

**Author:** [@logankilpatrick](https://discourse.julialang.org/u/logankilpatrick)\
**Replies:** 0\
**Last updated:** [February 24, 2022, 3:17pm UTC](https://discourse.julialang.org/t/what-is-the-closest-thing-to-tidymodels-in-julia/77026 "2022-02-24T15:17:16Z")

</div>

Coming from the R community, what is the closest thing to emulate the features provided by Tidymodels in Julia? I think it might be https://github.com/alan-turing-institute/MLJ.jl but I want to confirm with other folks w…

---

## [How to use the app generated by PackageCompiler.jl?](https://discourse.julialang.org/t/how-to-use-the-app-generated-by-packagecompiler-jl/76994)

<div class="topic-metadata">

**Author:** [@Carol](https://discourse.julialang.org/u/Carol)\
**Replies:** 1\
**Last updated:** [February 24, 2022, 2:34pm UTC](https://discourse.julialang.org/t/how-to-use-the-app-generated-by-packagecompiler-jl/76994 "2022-02-24T14:34:43Z")

</div>

Hi, I want to make an app for my Julia package named “MyApp”. Below is the simplified usage of MyApp in Julia: using MyApp, DataFrames, CSV, Distributions a = CSV.read("data.csv", Dataframe) b = "y=x" c = 1 d = Norma…

---

## [Accelerate pairwise damage computation](https://discourse.julialang.org/t/accelerate-pairwise-damage-computation/76278)

<div class="topic-metadata">

**Author:** [@maphdze](https://discourse.julialang.org/u/maphdze)\
**Replies:** 12\
**Last updated:** [February 24, 2022, 10:06am UTC](https://discourse.julialang.org/t/accelerate-pairwise-damage-computation/76278 "2022-02-24T10:06:56Z")

</div>

Can someone help me to accelerate the pairwise damage computation? This problem is very similar to the one in Accelerate pairwise L-J force computation. And I adopted the conclusion that the pairlist should be sorted fir…

---

## [Type computation: numerical type with twice more bits](https://discourse.julialang.org/t/type-computation-numerical-type-with-twice-more-bits/77000)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 3\
**Last updated:** [February 24, 2022, 9:42am UTC](https://discourse.julialang.org/t/type-computation-numerical-type-with-twice-more-bits/77000 "2022-02-24T09:42:47Z")

</div>

I’m trying to write a generic function accepting two Integers as arguments. The function will need a local variable storing the product of the two integers. So if the functions arguments are of type Int16, the local vari…

---

## [MbedTLS requires cmake for install, can it be avoided?](https://discourse.julialang.org/t/mbedtls-requires-cmake-for-install-can-it-be-avoided/77011)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 0\
**Last updated:** [February 24, 2022, 8:41am UTC](https://discourse.julialang.org/t/mbedtls-requires-cmake-for-install-can-it-be-avoided/77011 "2022-02-24T08:41:58Z")

</div>

I’m running a Julia HTTP application in a container, and I noticed that installing MbedTLS required me to install cmake, g++, etc in order to build something. I understand that binary dependencies are ideally satisfied b…

---

## [Error Compiling Julia on Apple M1](https://discourse.julialang.org/t/error-compiling-julia-on-apple-m1/76450)

<div class="topic-metadata">

**Author:** [@SEA](https://discourse.julialang.org/u/SEA)\
**Replies:** 5\
**Last updated:** [February 24, 2022, 5:51am UTC](https://discourse.julialang.org/t/error-compiling-julia-on-apple-m1/76450 "2022-02-24T05:51:11Z")

</div>

I am running into an error while compiling Julia from GitHub (both using today’s master and using this commit) on an M1 chip. I’d highly appreciate any help in resolving this. The specific error message is: make\[1\]: \*\*\*…

---

## [Embed python packages into julia](https://discourse.julialang.org/t/embed-python-packages-into-julia/76989)

<div class="topic-metadata">

**Author:** [@xspeng](https://discourse.julialang.org/u/xspeng)\
**Replies:** 4\
**Last updated:** [February 24, 2022, 1:29am UTC](https://discourse.julialang.org/t/embed-python-packages-into-julia/76989 "2022-02-24T01:29:12Z")

</div>

Hi, I have a problem with loading python package dragonfly into julia and call it, don’t know why, since with the same way it works for another case here https://discourse.julialang.org/t/call-python-packages-from-juli…

---

## [Performance issues with CartesianIndices](https://discourse.julialang.org/t/performance-issues-with-cartesianindices/76990)

<div class="topic-metadata">

**Author:** [@nchisholm](https://discourse.julialang.org/u/nchisholm)\
**Replies:** 5\
**Last updated:** [February 24, 2022, 2:54am UTC](https://discourse.julialang.org/t/performance-issues-with-cartesianindices/76990 "2022-02-24T02:54:19Z")

</div>

I am encountering a handful of performance issues using CartesianIndices (versus using hard-coded nested for loops) to write dimension-agnostic code: There is apparent runtime cost associated with using type parameters…

---

## [A Python-like breakpoint](https://discourse.julialang.org/t/a-python-like-breakpoint/76998)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 2\
**Last updated:** [February 24, 2022, 1:17am UTC](https://discourse.julialang.org/t/a-python-like-breakpoint/76998 "2022-02-24T01:17:22Z")

</div>

What’s the easiest way to implement/utilize a Python-like breakpoint? I know of Debugger.jl and the @bp macro, and it seems Julia has the potential to be far more powerful than Python’s breakpoint(), but I can’t figure o…

---

## [Unexpected Allocations with Multiple Dispatch](https://discourse.julialang.org/t/unexpected-allocations-with-multiple-dispatch/76988)

<div class="topic-metadata">

**Author:** [@pulsipher](https://discourse.julialang.org/u/pulsipher)\
**Replies:** 2\
**Last updated:** [February 23, 2022, 9:53pm UTC](https://discourse.julialang.org/t/unexpected-allocations-with-multiple-dispatch/76988 "2022-02-23T21:53:58Z")

</div>

I am setting up a multiple dispatch structure and get unexpected allocations when I use more than 3 dispatch types as illustrated in the MWE below: Consider the following composite types: for T in (:A, :B, :C) @eva…

---

## [How to build closed-source julia package?](https://discourse.julialang.org/t/how-to-build-closed-source-julia-package/76985)

<div class="topic-metadata">

**Author:** [@Carol](https://discourse.julialang.org/u/Carol)\
**Replies:** 1\
**Last updated:** [February 23, 2022, 5:58pm UTC](https://discourse.julialang.org/t/how-to-build-closed-source-julia-package/76985 "2022-02-23T17:58:00Z")

</div>

Hi all, I developed a Julia package locally, and I want to make it closed-source to protect the source code. I’m new to creating a closed-source package, and I want to ask whether creating a sysimage by PackageCompiler…

---

## [Sum result of Threads.foreach()](https://discourse.julialang.org/t/sum-result-of-threads-foreach/76701)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 10\
**Last updated:** [February 23, 2022, 5:41pm UTC](https://discourse.julialang.org/t/sum-result-of-threads-foreach/76701 "2022-02-23T17:41:02Z")

</div>

Hi! First, I read several other posts about adjacent problems to this, but I don’t think any of them had a direct answer. If this post is redundant, I apologize; I’m not sure what key terms to search to get more specifi…

---

## [Speeding up my code](https://discourse.julialang.org/t/speeding-up-my-code/76915)

<div class="topic-metadata">

**Author:** [@nicob](https://discourse.julialang.org/u/nicob)\
**Replies:** 7\
**Last updated:** [February 23, 2022, 5:40pm UTC](https://discourse.julialang.org/t/speeding-up-my-code/76915 "2022-02-23T17:40:25Z")

</div>

Hi, I’m quite new to Julia and I’m looking for suggestions to improve the performance of my code to hopefully beat the Python version. From these 2 functions do you see any margin of improvement? For example I’am trying…

---

## [Using environments](https://discourse.julialang.org/t/using-environments/76982)

<div class="topic-metadata">

**Author:** [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Replies:** 3\
**Last updated:** [February 23, 2022, 5:31pm UTC](https://discourse.julialang.org/t/using-environments/76982 "2022-02-23T17:31:06Z")

</div>

I’m trying to figure out how environments work in Julia. My understanding is that it creates a new empty package space where I can add different packages and work in isolation from other environments. So I create my new…

---

## [Reproducible builds and "Triangle of Secure Code Delivery"](https://discourse.julialang.org/t/reproducible-builds-and-triangle-of-secure-code-delivery/76971)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 2\
**Last updated:** [February 23, 2022, 4:13pm UTC](https://discourse.julialang.org/t/reproducible-builds-and-triangle-of-secure-code-delivery/76971 "2022-02-23T16:13:21Z")

</div>

How does Julia stack up (to other languages)? Reproducible Builds: Given the application’s source code, it should be possible to reproduce the distributed package exactly, down to contents that are known to vary be…

---

## [Is there any way to use max() and min() based on a function?](https://discourse.julialang.org/t/is-there-any-way-to-use-max-and-min-based-on-a-function/32350)

<div class="topic-metadata">

**Author:** [@yelircaasi](https://discourse.julialang.org/u/yelircaasi)\
**Replies:** 14\
**Last updated:** [February 23, 2022, 2:31pm UTC](https://discourse.julialang.org/t/is-there-any-way-to-use-max-and-min-based-on-a-function/32350 "2022-02-23T14:31:09Z")

</div>

This is easily done in, for example, Python, and can be very useful. I have spent quite a bit of time searching documentation and reading forum questions, without finding anything. Here’s a small example of what I would…

---

## [Initializing an empty Julia array with unknown size](https://discourse.julialang.org/t/initializing-an-empty-julia-array-with-unknown-size/76967)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 8\
**Last updated:** [February 23, 2022, 1:43pm UTC](https://discourse.julialang.org/t/initializing-an-empty-julia-array-with-unknown-size/76967 "2022-02-23T13:43:00Z")

</div>

I have 6 different scenarios, and under each scenario, there could be one to 100 models available for me to get the data. My goal is to store them in A as below (n is an unknown number between 1 and 100): for i in 1:6 #…

---

## [How to create SMatrix from SVectors efficiently](https://discourse.julialang.org/t/how-to-create-smatrix-from-svectors-efficiently/76969)

<div class="topic-metadata">

**Author:** [@ncxst](https://discourse.julialang.org/u/ncxst)\
**Replies:** 1\
**Last updated:** [February 23, 2022, 12:48pm UTC](https://discourse.julialang.org/t/how-to-create-smatrix-from-svectors-efficiently/76969 "2022-02-23T12:48:31Z")

</div>

Hi, I have a function f(i) = SA\[i,2i\] that generates SVectors. I want to concatenate a small, but variable amount of them into a SMatrix. For a fixed amount I can do: julia\> \[f(1) f(2) f(3)\]' 3×2 SMatrix{3, 2, Int64, 6…

---

## [Cant use Plots inside tmux](https://discourse.julialang.org/t/cant-use-plots-inside-tmux/76911)

<div class="topic-metadata">

**Author:** [@carlomontec](https://discourse.julialang.org/u/carlomontec)\
**Replies:** 2\
**Last updated:** [February 23, 2022, 10:32am UTC](https://discourse.julialang.org/t/cant-use-plots-inside-tmux/76911 "2022-02-23T10:32:32Z")

</div>

Hello, seems I cannot load Plots when I open Julia inside a tmux session in PopOS! 20.04 in my local computer: carlo@pclinux:/media/carlo/tests/$ julia172 \_ \_ \_ \_(\_)\_ | Documentation: http…

---

## [Precompiling GR\_jll failed](https://discourse.julialang.org/t/precompiling-gr-jll-failed/76964)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 1\
**Last updated:** [February 23, 2022, 9:44am UTC](https://discourse.julialang.org/t/precompiling-gr-jll-failed/76964 "2022-02-23T09:44:07Z")

</div>

(@v1.6) pkg\> precompile Precompiling project... ✗ GR\_jll 0 dependencies successfully precompiled in 3 seconds (277 already precompiled) What should I do? Thanks a lot.

---

## [How to set the julia.executablePath in VS Code on MacOS-12?](https://discourse.julialang.org/t/how-to-set-the-julia-executablepath-in-vs-code-on-macos-12/76760)

<div class="topic-metadata">

**Author:** [@jjdegruijter](https://discourse.julialang.org/u/jjdegruijter)\
**Replies:** 8\
**Last updated:** [February 23, 2022, 9:15am UTC](https://discourse.julialang.org/t/how-to-set-the-julia-executablepath-in-vs-code-on-macos-12/76760 "2022-02-23T09:15:15Z")

</div>

I installed julia-1.6 and VS Code both in my Applications folder. Then I got the Julia extension from the VS Code Marketplace. As this extension does not find my Julia installation automatically, I shoud set the julia.e…

---

## [How do I create a new dataframe column by dividing individual elements in two dataframe columns?](https://discourse.julialang.org/t/how-do-i-create-a-new-dataframe-column-by-dividing-individual-elements-in-two-dataframe-columns/76931)

<div class="topic-metadata">

**Author:** [@a.frist](https://discourse.julialang.org/u/a.frist)\
**Replies:** 4\
**Last updated:** [February 23, 2022, 7:44am UTC](https://discourse.julialang.org/t/how-do-i-create-a-new-dataframe-column-by-dividing-individual-elements-in-two-dataframe-columns/76931 "2022-02-23T07:44:15Z")

</div>

I have the following dataframe: \[ Info: Displaying top ten rows of the pij\_df dataframe... ┌ Info: 10×5 DataFrame │ Row │ MONTH TOPIC\_I TOPIC\_J JOINT\_PROB\_SUM DOC\_COUNT\_SUM │ │ Int64 String15 String15 F…

---

## [Unexpected behaviour with integer sqrt and integer ^](https://discourse.julialang.org/t/unexpected-behaviour-with-integer-sqrt-and-integer/76897)

<div class="topic-metadata">

**Author:** [@Kevin\_Kleinbeck](https://discourse.julialang.org/u/Kevin_Kleinbeck)\
**Replies:** 10\
**Last updated:** [February 23, 2022, 7:32am UTC](https://discourse.julialang.org/t/unexpected-behaviour-with-integer-sqrt-and-integer/76897 "2022-02-23T07:32:55Z")

</div>

Motivation: I stumbled upon √(16)^16 # 0.0 and √(17)^17 # DomainError with -2.8632214305930583e18: The reason: This is of course due to integer arithmetic. On my machine: 16^16 # 0 17^17 # -2863221430593058543 Why…

---

## [How to \`unsafe\_wrap()\` with array of struct?](https://discourse.julialang.org/t/how-to-unsafe-wrap-with-array-of-struct/76952)

<div class="topic-metadata">

**Author:** [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Replies:** 0\
**Last updated:** [February 23, 2022, 3:32am UTC](https://discourse.julialang.org/t/how-to-unsafe-wrap-with-array-of-struct/76952 "2022-02-23T03:32:48Z")

</div>

I have C code that returns an array of struct using pointer: mutable struct Result value :: Cdouble len\_sequence :: Cint # length of sequence\[\] sequence :: Ptr{Cint} end mutable struct ResultList len…

---

## [How to convert comma-seperated number to number?](https://discourse.julialang.org/t/how-to-convert-comma-seperated-number-to-number/76906)

<div class="topic-metadata">

**Author:** [@yummy527](https://discourse.julialang.org/u/yummy527)\
**Replies:** 7\
**Last updated:** [February 23, 2022, 3:47am UTC](https://discourse.julialang.org/t/how-to-convert-comma-seperated-number-to-number/76906 "2022-02-23T03:47:59Z")

</div>

Data are read from excel xls file in which some numbers are stored as text and comma-seperated. excel screenshot: Dataframe sreenshot (read using ExcelFiles.jl): I have tried function tryparse or parse, but it doe…

---

## [Interpreting raw memory as a vector of unions](https://discourse.julialang.org/t/interpreting-raw-memory-as-a-vector-of-unions/61128)

<div class="topic-metadata">

**Author:** [@Sheemon7](https://discourse.julialang.org/u/Sheemon7)\
**Replies:** 4\
**Last updated:** [February 23, 2022, 1:24am UTC](https://discourse.julialang.org/t/interpreting-raw-memory-as-a-vector-of-unions/61128 "2022-02-23T01:24:00Z")

</div>

To avoid excessive allocation & garbage collection for performance critical applications, I sometimes use the following approach (simplified): buffer = pointer(Vector{UInt8}(undef, 100)) function alloc(::Type{T}, n, off…

---

## [A Python-like REPL?](https://discourse.julialang.org/t/a-python-like-repl/76944)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 2\
**Last updated:** [February 23, 2022, 12:53am UTC](https://discourse.julialang.org/t/a-python-like-repl/76944 "2022-02-23T00:53:27Z")

</div>

The current Julia REPL behaves like MATLAB’s Command Window, that’s, it displays the output by default unless a line is terminated with a semi-colon ; (except inner-lines). Python’s REPL, on the other hand, doesn’t show …

---

## [Julia causing latency?](https://discourse.julialang.org/t/julia-causing-latency/76938)

<div class="topic-metadata">

**Author:** [@croberts](https://discourse.julialang.org/u/croberts)\
**Replies:** 4\
**Last updated:** [February 22, 2022, 11:15pm UTC](https://discourse.julialang.org/t/julia-causing-latency/76938 "2022-02-22T23:15:52Z")

</div>

I have used Julia for several years, love it. I recently installed Julia 1.7.2 on a new Windows machine. After running some code in the REPL (to rule out VSCode being at fault), I am getting significant latency for all…

---

## [Symmetric matrices](https://discourse.julialang.org/t/symmetric-matrices/4086)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 13\
**Last updated:** [February 22, 2022, 11:04pm UTC](https://discourse.julialang.org/t/symmetric-matrices/4086 "2022-02-22T23:04:12Z")

</div>

According to the docs, we are able to create a Symmetric matrix from another matrix that is already stored in memory: A = eye(3) B = Symmetric(A) sizeof(A) # 72 bytes sizeof(B) # 16 bytes How to populate a Symmetric ma…

---

## [Broadcasting getindex for a range](https://discourse.julialang.org/t/broadcasting-getindex-for-a-range/76937)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 1\
**Last updated:** [February 22, 2022, 8:57pm UTC](https://discourse.julialang.org/t/broadcasting-getindex-for-a-range/76937 "2022-02-22T20:57:30Z")

</div>

Given vv is a Vector{Vector} shouldn’t broadcasting to get a range getindex.(vv, UnitRange) work ? Let’s say I have: ar = \[\[1,2,3\], \[4,5,6\], \[7,8,9\]\] getindex.(ar, 2:3) ERROR: DimensionMismatch("arrays could not be br…

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

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