# General Usage

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

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

**Page:** 246

---

## [Efficiently merge multiple .arrow files (12 files totaling 2.5 TB) into a single DataFrame for effective data analysis while minimizing memory overhead](https://discourse.julialang.org/t/efficiently-merge-multiple-arrow-files-12-files-totaling-2-5-tb-into-a-single-dataframe-for-effective-data-analysis-while-minimizing-memory-overhead/104110)

<div class="topic-metadata">

**Author:** [@ujjwal\_singh](https://discourse.julialang.org/u/ujjwal_singh)\
**Replies:** 14\
**Last updated:** [September 22, 2023, 9:17am UTC](https://discourse.julialang.org/t/efficiently-merge-multiple-arrow-files-12-files-totaling-2-5-tb-into-a-single-dataframe-for-effective-data-analysis-while-minimizing-memory-overhead/104110 "2023-09-22T09:17:48Z")

</div>

Could someone please guide me on how to merge multiple large .arrow files (12 files totaling 2.5 TB) into a single DataFrame with minimal memory overhead for big data analysis? I have a total of 1 TB of RAM; can I manage…

---

## [How to customize display and plot of a sparse matrix?](https://discourse.julialang.org/t/how-to-customize-display-and-plot-of-a-sparse-matrix/104099)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 6\
**Last updated:** [September 21, 2023, 8:28pm UTC](https://discourse.julialang.org/t/how-to-customize-display-and-plot-of-a-sparse-matrix/104099 "2023-09-21T20:28:31Z")

</div>

Hey, I have 2 questions regarding displaying SparseArrays. (1) When using SparseArrays the code n=15; x=sprand(Float16,n,n,0.3); x.nzval .=1; display(x) produces 15×15 SparseMatrixCSC{Float16, Int64} with 67 sto…

---

## [How to call the "logical and" operator as a function?](https://discourse.julialang.org/t/how-to-call-the-logical-and-operator-as-a-function/104094)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 6\
**Last updated:** [September 21, 2023, 7:56pm UTC](https://discourse.julialang.org/t/how-to-call-the-logical-and-operator-as-a-function/104094 "2023-09-21T19:56:42Z")

</div>

We can call the add operator as Base.:+. Can I do the same to logical and? julia\> Base.:+(3, 4) 7 julia\> Base.:&&(true, false) ERROR: UndefVarError: && not defined Stacktrace: \[1\] getproperty(x::Module, f::Symbol) …

---

## [ImageInTerminal with Plots integration in a sixel-enabled terminal works in Julia 1.8, not 1.9rc2](https://discourse.julialang.org/t/imageinterminal-with-plots-integration-in-a-sixel-enabled-terminal-works-in-julia-1-8-not-1-9rc2/97609)

<div class="topic-metadata">

**Author:** [@jdad](https://discourse.julialang.org/u/jdad)\
**Replies:** 2\
**Last updated:** [September 21, 2023, 7:43pm UTC](https://discourse.julialang.org/t/imageinterminal-with-plots-integration-in-a-sixel-enabled-terminal-works-in-julia-1-8-not-1-9rc2/97609 "2023-09-21T19:43:29Z")

</div>

I was trying to use ImageInTerminal with Plots in a sixel-enabled terminal (eg, either mlterm or latest Konsole), I was surprised that, when all graphics correctly appeared inside the terminal with Julia 1.8, only image …

---

## [Providing {N} with type alias](https://discourse.julialang.org/t/providing-n-with-type-alias/104089)

<div class="topic-metadata">

**Author:** [@jondavis847](https://discourse.julialang.org/u/jondavis847)\
**Replies:** 8\
**Last updated:** [September 21, 2023, 7:39pm UTC](https://discourse.julialang.org/t/providing-n-with-type-alias/104089 "2023-09-21T19:39:09Z")

</div>

Using StaticArrays and parametric types, I can successfully produce subtyped SVectors. using StaticArrays abstract type A{N,T} \<: StaticVector{N,T} end @inline Base.getindex(a::A, i::Int64) = (@boundscheck checkbounds(…

---

## [What is idiomatic way of vectorizing longer operations in Julia?](https://discourse.julialang.org/t/what-is-idiomatic-way-of-vectorizing-longer-operations-in-julia/104117)

<div class="topic-metadata">

**Author:** [@Devetak](https://discourse.julialang.org/u/Devetak)\
**Replies:** 5\
**Last updated:** [September 21, 2023, 6:22pm UTC](https://discourse.julialang.org/t/what-is-idiomatic-way-of-vectorizing-longer-operations-in-julia/104117 "2023-09-21T18:22:06Z")

</div>

Hello. I have recently tried writing some code and need help with vectorization. I like that Julia’s loops are efficient, but sometimes I want to write less verbose code. How to do it in this case? What are the best pra…

---

## [Most efficient way to compute the roots of an equation involving Bessel functions?](https://discourse.julialang.org/t/most-efficient-way-to-compute-the-roots-of-an-equation-involving-bessel-functions/104112)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 2\
**Last updated:** [September 21, 2023, 5:09pm UTC](https://discourse.julialang.org/t/most-efficient-way-to-compute-the-roots-of-an-equation-involving-bessel-functions/104112 "2023-09-21T17:09:57Z")

</div>

I was wondering about what would be the most computationally efficient way in Julia to compute the zeros of the following equation involving Bessel functions derivatives: J\_m'(x)Y\_m'(ax)-J\_m'(ax)Y\_m'(x)=0, where a is a…

---

## [Command hangs: \`run(pipeline(\`git diff\`, stderr=err, stdout=out), wait=true)\`](https://discourse.julialang.org/t/command-hangs-run-pipeline-git-diff-stderr-err-stdout-out-wait-true/103742)

<div class="topic-metadata">

**Author:** [@adomasbaliuka](https://discourse.julialang.org/u/adomasbaliuka)\
**Replies:** 3\
**Last updated:** [September 21, 2023, 9:05am UTC](https://discourse.julialang.org/t/command-hangs-run-pipeline-git-diff-stderr-err-stdout-out-wait-true/103742 "2023-09-21T09:05:43Z")

</div>

(Found while debugging DrWatson.jl) Setup (git repo with changed file): # julia 1.9.3, Commit bed2cd540a1 (2023-08-24 14:43 UTC) shell\> mkdir JuliaGitWithPipeHangs shell\> cd JuliaGitWithPipeHangs shell\> git init Initia…

---

## [ExampleSysimage The specified module could not be found](https://discourse.julialang.org/t/examplesysimage-the-specified-module-could-not-be-found/87039)

<div class="topic-metadata">

**Author:** [@AbhimanyuAryan](https://discourse.julialang.org/u/AbhimanyuAryan)\
**Replies:** 4\
**Last updated:** [September 21, 2023, 8:53am UTC](https://discourse.julialang.org/t/examplesysimage-the-specified-module-could-not-be-found/87039 "2023-09-21T08:53:23Z")

</div>

I compiled a sys image from guide given here: Sysimages · PackageCompiler julia\> versioninfo() Julia Version 1.8.0 Commit 5544a0fab7 (2022-08-17 13:38 UTC) Platform Info: OS: Windows (x86\_64-w64-mingw32) CPU: 16 × A…

---

## [Why the function sum1 is faster than builtin sum](https://discourse.julialang.org/t/why-the-function-sum1-is-faster-than-builtin-sum/104051)

<div class="topic-metadata">

**Author:** [@VinodV](https://discourse.julialang.org/u/VinodV)\
**Replies:** 14\
**Last updated:** [September 21, 2023, 8:17am UTC](https://discourse.julialang.org/t/why-the-function-sum1-is-faster-than-builtin-sum/104051 "2023-09-21T08:17:21Z")

</div>

julia\> using BenchmarkTools julia\> function sum1(num) total = 0 for i in num total += i end return total end sum1 (generic function with 1 method) julia\> a = coll…

---

## [GR Mesh Shading](https://discourse.julialang.org/t/gr-mesh-shading/104092)

<div class="topic-metadata">

**Author:** [@Ian\_L](https://discourse.julialang.org/u/Ian_L)\
**Replies:** 0\
**Last updated:** [September 21, 2023, 5:43am UTC](https://discourse.julialang.org/t/gr-mesh-shading/104092 "2023-09-21T05:43:50Z")

</div>

Hi, I was looking at Mesh3d · Plots and noticed there is no shading for the GR backend. Does anyone know the parameter to set this on? Thanks

---

## [Tools for partitioning matrix columns?](https://discourse.julialang.org/t/tools-for-partitioning-matrix-columns/104055)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [September 21, 2023, 5:25am UTC](https://discourse.julialang.org/t/tools-for-partitioning-matrix-columns/104055 "2023-09-21T05:25:45Z")

</div>

Hello, I am looking for a convenient package to partition matrices into smaller matrices (ie. cut along the 2nd dim). However, I specifically need to be able to make partitions of unequal sizes. Let me illustrate with …

---

## [Tullio - missing elements in vectors](https://discourse.julialang.org/t/tullio-missing-elements-in-vectors/104091)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 0\
**Last updated:** [September 21, 2023, 4:44am UTC](https://discourse.julialang.org/t/tullio-missing-elements-in-vectors/104091 "2023-09-21T04:44:03Z")

</div>

Is it possible to do X::Vector{Any}=zeros(2) @tullio X\[i\] = \[1,missing\]\[i\] in one line? something like @tullio X\[i\]::Vector{Any} := \[1,missing\]\[i\] Also, is it possible to apply a custom aggregation function? some…

---

## [How to construct a struct with common field values efficiently](https://discourse.julialang.org/t/how-to-construct-a-struct-with-common-field-values-efficiently/104047)

<div class="topic-metadata">

**Author:** [@lukemin](https://discourse.julialang.org/u/lukemin)\
**Replies:** 32\
**Last updated:** [September 21, 2023, 3:13am UTC](https://discourse.julialang.org/t/how-to-construct-a-struct-with-common-field-values-efficiently/104047 "2023-09-21T03:13:35Z")

</div>

I am now developing a code which makes use of a huge number of modulo arithmetic. For a better readability, I tried to define custom types Modulus and ModNum. Modulus contains some values which is essential for the mod…

---

## [Convert unixtime to yyyymmdd::Int](https://discourse.julialang.org/t/convert-unixtime-to-yyyymmdd-int/104077)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 3\
**Last updated:** [September 20, 2023, 9:58pm UTC](https://discourse.julialang.org/t/convert-unixtime-to-yyyymmdd-int/104077 "2023-09-20T21:58:27Z")

</div>

Hello, how can I make this code more optimal? import Dates const Unixtime = Int function unix2yyyymmdd(unixtime::Unixtime)::Int datetime = Dates.unix2datetime(unixtime) date = floor(datetime, Dates.Day) st…

---

## [Calling function from Makie Buttons and Menus](https://discourse.julialang.org/t/calling-function-from-makie-buttons-and-menus/103043)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 5\
**Last updated:** [September 20, 2023, 8:09pm UTC](https://discourse.julialang.org/t/calling-function-from-makie-buttons-and-menus/103043 "2023-09-20T20:09:28Z")

</div>

Hi everytone. I am trying to build a GUI to call a bunch of my functions. It is based on Makie as it was suggested in this forum because the idea is to read a data file and them cut, filter, etc the data while displayin…

---

## [How to Use Differential Equations to Model Phenomena in Patient Medical Records?](https://discourse.julialang.org/t/how-to-use-differential-equations-to-model-phenomena-in-patient-medical-records/104074)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 0\
**Last updated:** [September 20, 2023, 6:19pm UTC](https://discourse.julialang.org/t/how-to-use-differential-equations-to-model-phenomena-in-patient-medical-records/104074 "2023-09-20T18:19:20Z")

</div>

Hi folks, :wave: I am super thrilled to say I am finally making an initial foray into the SciML ecosystem! In brief, I am in a mathematical modeling course particularly utilizing Differential Equations to model various …

---

## [Finding matrices with the same l1 and l2 norm](https://discourse.julialang.org/t/finding-matrices-with-the-same-l1-and-l2-norm/89404)

<div class="topic-metadata">

**Author:** [@ccccc](https://discourse.julialang.org/u/ccccc)\
**Replies:** 12\
**Last updated:** [November 1, 2022, 11:37pm UTC](https://discourse.julialang.org/t/finding-matrices-with-the-same-l1-and-l2-norm/89404 "2022-11-01T23:37:50Z")

</div>

I want to begin with a matrix, A, and find a matrix where the l2 norm is the same as it is for A, but the l1 norm is reduced so that it is the same as the l2 norm. There is only 1 eigenvalue, which is the square of the l…

---

## [Julian Alternative to Template by Value](https://discourse.julialang.org/t/julian-alternative-to-template-by-value/104070)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 3\
**Last updated:** [September 20, 2023, 6:08pm UTC](https://discourse.julialang.org/t/julian-alternative-to-template-by-value/104070 "2023-09-20T18:08:34Z")

</div>

I often find myself writing functions where the algorithm implemented depends on the value of an integer. For example, in numerical analysis I often have some numerical method, with 1st, 2nd, 3rd, and 4th order versions …

---

## [Filtering DataFrame on variable attribute type](https://discourse.julialang.org/t/filtering-dataframe-on-variable-attribute-type/104059)

<div class="topic-metadata">

**Author:** [@edo-0071](https://discourse.julialang.org/u/edo-0071)\
**Replies:** 1\
**Last updated:** [September 20, 2023, 5:49pm UTC](https://discourse.julialang.org/t/filtering-dataframe-on-variable-attribute-type/104059 "2023-09-20T17:49:50Z")

</div>

Hi, i have a simple DataFrame and want to extract rows that match certain values ​​for some (not necessarily all) attributes. Starting from here, res = @from i in df begin @where i.A = "a1" @select i @collect DataFrame…

---

## [How to write type stable code with branches, where one branch calls a complicated function?](https://discourse.julialang.org/t/how-to-write-type-stable-code-with-branches-where-one-branch-calls-a-complicated-function/102958)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 14\
**Last updated:** [September 20, 2023, 4:04pm UTC](https://discourse.julialang.org/t/how-to-write-type-stable-code-with-branches-where-one-branch-calls-a-complicated-function/102958 "2023-09-20T16:04:05Z")

</div>

I’m having a hard time writing a type-stable function where one branch calls a complicated function and another one doesn’t. Here’s a minified example: using Distributions function f(μ::Real, σ::Real, a::Real) if i…

---

## [How to best parallelize matrix operations?](https://discourse.julialang.org/t/how-to-best-parallelize-matrix-operations/103895)

<div class="topic-metadata">

**Author:** [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Replies:** 1\
**Last updated:** [September 20, 2023, 3:57pm UTC](https://discourse.julialang.org/t/how-to-best-parallelize-matrix-operations/103895 "2023-09-20T15:57:28Z")

</div>

I need to do some operations on 3-dimensional matrices and would like to explore getting some speed ups with parallelization. I have a version working using map and @spawn as suggestetd here, and I get the right values, …

---

## [Matplotlib rcParams in module \_\_init\_\_() function segfault on M1](https://discourse.julialang.org/t/matplotlib-rcparams-in-module-init-function-segfault-on-m1/103314)

<div class="topic-metadata">

**Author:** [@hsgg](https://discourse.julialang.org/u/hsgg)\
**Replies:** 5\
**Last updated:** [September 20, 2023, 2:04pm UTC](https://discourse.julialang.org/t/matplotlib-rcparams-in-module-init-function-segfault-on-m1/103314 "2023-09-20T14:04:38Z")

</div>

Hi, I am converting a package from PyCall.jl to PythonCall.jl. (I am planning on calling Julia from Python in the future, and I want to test whether to use PythonCall/JuliaCall or PyCall/pyjulia. PythonCall/JuliaCall app…

---

## [Very different performance on M1 mac, native vs rosetta](https://discourse.julialang.org/t/very-different-performance-on-m1-mac-native-vs-rosetta/66845)

<div class="topic-metadata">

**Author:** [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Replies:** 14\
**Last updated:** [September 20, 2023, 12:29pm UTC](https://discourse.julialang.org/t/very-different-performance-on-m1-mac-native-vs-rosetta/66845 "2023-09-20T12:29:00Z")

</div>

I was trying the argmin vs minimum benchark that was being discussed and found that the native arm julia is almost 5x slower than running in rosetta. Is the arm codegen that much worse or is that a bug with the M1 specif…

---

## [Proper way to define macros that declare functions?](https://discourse.julialang.org/t/proper-way-to-define-macros-that-declare-functions/104058)

<div class="topic-metadata">

**Author:** [@Vincent\_Picaud](https://discourse.julialang.org/u/Vincent_Picaud)\
**Replies:** 4\
**Last updated:** [September 20, 2023, 11:18am UTC](https://discourse.julialang.org/t/proper-way-to-define-macros-that-declare-functions/104058 "2023-09-20T11:18:53Z")

</div>

I define a create\_foo macro that declares a function foo. I want to be able to declare foo functions in the module where the macro is defined. This part is OK as this minimal example shows: module Foo macro cr…

---

## [Avoiding intermediate vector allocations in matrix to scalar computations](https://discourse.julialang.org/t/avoiding-intermediate-vector-allocations-in-matrix-to-scalar-computations/104021)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 6\
**Last updated:** [September 20, 2023, 9:48am UTC](https://discourse.julialang.org/t/avoiding-intermediate-vector-allocations-in-matrix-to-scalar-computations/104021 "2023-09-20T09:48:16Z")

</div>

I recently noticed that the computation of a scalar from vector' \* matrix \* vector is allocating memory. This isn’t hugely surprising - the output of the first multiplication is a vector. However, the allocation can easi…

---

## [GUI + Makie](https://discourse.julialang.org/t/gui-makie/102668)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 6\
**Last updated:** [September 20, 2023, 8:23am UTC](https://discourse.julialang.org/t/gui-makie/102668 "2023-09-20T08:23:28Z")

</div>

Hi every one. I have build a nice set of functions for my work to process some data. Most of the processing is done by this functions but there is a lot of plotting involve. I would like to merge all the plotting (Don…

---

## [Kaleido Startup Failed due to Pipes](https://discourse.julialang.org/t/kaleido-startup-failed-due-to-pipes/103550)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 1\
**Last updated:** [September 20, 2023, 2:33am UTC](https://discourse.julialang.org/t/kaleido-startup-failed-due-to-pipes/103550 "2023-09-20T02:33:33Z")

</div>

I opened this issue But I’m wondering if anyone here might have a clue as to what is going on. I installed PlotlyKaleido.jl and ran the PlotlyKaleido.start() which yielded: ERROR: Kaleido startup failed. Stacktrace:…

---

## [Docker Task Error (SIGINT)](https://discourse.julialang.org/t/docker-task-error-sigint/104036)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 5\
**Last updated:** [September 20, 2023, 1:59am UTC](https://discourse.julialang.org/t/docker-task-error-sigint/104036 "2023-09-20T01:59:10Z")

</div>

I’m trying to run some code in a Docker container on AWS. It works locally, but fails with a cryptic error once in the Cloud. I can’t find a MWE because the stack trace really doesn’t give me much information to go off o…

---

## [Idea for shortening stacktraces](https://discourse.julialang.org/t/idea-for-shortening-stacktraces/103994)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 5\
**Last updated:** [September 19, 2023, 9:36pm UTC](https://discourse.julialang.org/t/idea-for-shortening-stacktraces/103994 "2023-09-19T21:36:16Z")

</div>

There are already approaches for shortening stack traces in external packages, but I’ve been wanting something a little less based on others’ heuristics and more on my own knowledge about the functions I write. So the i…

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

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