# General Usage

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

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

**Page:** 362

---

## [Transforming DataFrame from column of vector](https://discourse.julialang.org/t/transforming-dataframe-from-column-of-vector/91058)

<div class="topic-metadata">

**Author:** [@vzion](https://discourse.julialang.org/u/vzion)\
**Replies:** 3\
**Last updated:** [December 1, 2022, 9:15am UTC](https://discourse.julialang.org/t/transforming-dataframe-from-column-of-vector/91058 "2022-12-01T09:15:38Z")

</div>

Hello, I would like to transform a DataFrame like this : df = DataFrame(a=\[1,2\],b=\["yes","no"\],c=\[\["a","b","c"\],\["d"\]\]) ┌───────┬────────┬─────────────────┐ │ a │ b │ c │ │ Int64 │ String │ Vect…

---

## [Fast display of an array as an image](https://discourse.julialang.org/t/fast-display-of-an-array-as-an-image/91074)

<div class="topic-metadata">

**Author:** [@Nathaniel](https://discourse.julialang.org/u/Nathaniel)\
**Replies:** 13\
**Last updated:** [December 1, 2022, 8:52am UTC](https://discourse.julialang.org/t/fast-display-of-an-array-as-an-image/91074 "2022-12-01T08:52:34Z")

</div>

I’m playing around with cellular automata and related systems, and I’m looking for a fast way to display them as they run. Currently I’m using ImageView.imshow, which works, but it’s very, very slow - I can’t even resiz…

---

## [Local Python file in module?](https://discourse.julialang.org/t/local-python-file-in-module/91080)

<div class="topic-metadata">

**Author:** [@polhager](https://discourse.julialang.org/u/polhager)\
**Replies:** 3\
**Last updated:** [December 1, 2022, 8:53am UTC](https://discourse.julialang.org/t/local-python-file-in-module/91080 "2022-12-01T08:53:27Z")

</div>

Hi! I’m trying to create a Julia module which uses functions from a Python file in the same directory. The setup is this: In the same directory I have two files. A mypythonfile.py def myfunction(): print("Hello!") and…

---

## [How can I get average of the multidimensional matrix datas in Julia?](https://discourse.julialang.org/t/how-can-i-get-average-of-the-multidimensional-matrix-datas-in-julia/91075)

<div class="topic-metadata">

**Author:** [@dangda](https://discourse.julialang.org/u/dangda)\
**Replies:** 4\
**Last updated:** [December 1, 2022, 6:03am UTC](https://discourse.julialang.org/t/how-can-i-get-average-of-the-multidimensional-matrix-datas-in-julia/91075 "2022-12-01T06:03:33Z")

</div>

Can I get average of multidimensional matrix datas in same place in Julia? such as… A={2 4 6 8 10 12} B={4 6 8 10 12 14} Average={3 5 7 9 11 13} However I cannot use any statistics method in my data.(using Statis…

---

## [Nested loop confusion](https://discourse.julialang.org/t/nested-loop-confusion/91068)

<div class="topic-metadata">

**Author:** [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Replies:** 3\
**Last updated:** [December 1, 2022, 5:31am UTC](https://discourse.julialang.org/t/nested-loop-confusion/91068 "2022-12-01T05:31:44Z")

</div>

Hi all, I don’t work much with comprehensions of nested loops, but I came across something which is probably obvious but unexpected to me. Why is there a difference between these two approaches to the nested loop? Witho…

---

## [Inverse of bitstring(x)](https://discourse.julialang.org/t/inverse-of-bitstring-x/91032)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 4\
**Last updated:** [December 1, 2022, 4:25am UTC](https://discourse.julialang.org/t/inverse-of-bitstring-x/91032 "2022-12-01T04:25:29Z")

</div>

What function f is f(typeof(x), bitstring(x)) == x ?

---

## [Term.jl color scheme for light background](https://discourse.julialang.org/t/term-jl-color-scheme-for-light-background/86912)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 5\
**Last updated:** [November 30, 2022, 11:11pm UTC](https://discourse.julialang.org/t/term-jl-color-scheme-for-light-background/86912 "2022-11-30T23:11:17Z")

</div>

The default colors in Term.jl are clearly designed for a dark background terminal: Does anyone have a good Term.jl color scheme for a white background terminal?

---

## [Performant Recursive Anonymous Functions](https://discourse.julialang.org/t/performant-recursive-anonymous-functions/90984)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 23\
**Last updated:** [November 30, 2022, 11:01pm UTC](https://discourse.julialang.org/t/performant-recursive-anonymous-functions/90984 "2022-11-30T23:01:28Z")

</div>

What’s the preferred way to write recursive anonymous functions? Consider a demo function: julia\> function fib(n) n ≤ 1 && return n return fib(n-1) + fib(n-2) end fib (generic function with…

---

## [Strange Revise error](https://discourse.julialang.org/t/strange-revise-error/91018)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 4\
**Last updated:** [November 30, 2022, 10:45pm UTC](https://discourse.julialang.org/t/strange-revise-error/91018 "2022-11-30T22:45:30Z")

</div>

I have run into a strange error that appears to be related to Revise. Revise reports a problem with a function Revise error messagejulia\> Revise.retry() ┌ Error: Failed to revise /home/brian/repos/Differentiation/src…

---

## [Rational ^ Rational](https://discourse.julialang.org/t/rational-rational/91063)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 5\
**Last updated:** [November 30, 2022, 9:57pm UTC](https://discourse.julialang.org/t/rational-rational/91063 "2022-11-30T21:57:48Z")

</div>

Why does this make a Float64 instead of a Rational? julia\> ((2//1)^(-4//1)) 0.0625 Is this the only way to get a Rational out of exponentiation? julia\> Rational((2//1)^(-4//1)) 1//16

---

## [Adding non-source files to a package](https://discourse.julialang.org/t/adding-non-source-files-to-a-package/91017)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 5\
**Last updated:** [November 30, 2022, 9:52pm UTC](https://discourse.julialang.org/t/adding-non-source-files-to-a-package/91017 "2022-11-30T21:52:57Z")

</div>

Is it possible to access non-source files in a package git? specifically, I would like a text file used for testing the package to be available to users of the package. When I just placed the text file in the root dire…

---

## [State of the Art for Data Version Control?](https://discourse.julialang.org/t/state-of-the-art-for-data-version-control/90246)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 5\
**Last updated:** [November 30, 2022, 9:52pm UTC](https://discourse.julialang.org/t/state-of-the-art-for-data-version-control/90246 "2022-11-30T21:52:41Z")

</div>

Hi folks! I am working with DrWatson.jl and am wondering: is there any suggested tools or workflows to handle data version control within Julia? I saw that there was DataSets.jl made by @Chris\_Foster and some ongoing d…

---

## [Julia pmap how to write each worker into separate index using parallel computing](https://discourse.julialang.org/t/julia-pmap-how-to-write-each-worker-into-separate-index-using-parallel-computing/90961)

<div class="topic-metadata">

**Author:** [@Pedro\_Raposo](https://discourse.julialang.org/u/Pedro_Raposo)\
**Replies:** 16\
**Last updated:** [November 30, 2022, 9:07pm UTC](https://discourse.julialang.org/t/julia-pmap-how-to-write-each-worker-into-separate-index-using-parallel-computing/90961 "2022-11-30T21:07:29Z")

</div>

I have a function that runs a simulation exercise. I call the function “raposo” and it has an output that is a vector (1,9). I need to compute it using parallel computing because it is taking 3 months to produce the outp…

---

## [How to programmatically update my PackageCompiler's sysimage, using a precompile\_execution\_file?](https://discourse.julialang.org/t/how-to-programmatically-update-my-packagecompilers-sysimage-using-a-precompile-execution-file/91050)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 1\
**Last updated:** [November 30, 2022, 8:55pm UTC](https://discourse.julialang.org/t/how-to-programmatically-update-my-packagecompilers-sysimage-using-a-precompile-execution-file/91050 "2022-11-30T20:55:58Z")

</div>

Hi all! I am using PackageCompiler to speed up Julia usage. It works enthusiastically well, and it saves me some time, but I also want to keep the sysimage updated. Specifically, I want to update it (even manually) once…

---

## [Working with multiple columns in DataFramesMeta, programmatically](https://discourse.julialang.org/t/working-with-multiple-columns-in-dataframesmeta-programmatically/91056)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 10\
**Last updated:** [November 30, 2022, 7:27pm UTC](https://discourse.julialang.org/t/working-with-multiple-columns-in-dataframesmeta-programmatically/91056 "2022-11-30T19:27:11Z")

</div>

Suppose I have the following DataFrame: test = DataFrame( w = \[10, 13, 5\], a1 = \[12, 9, 6\], a2 = \[9, 10, 8\], a3 = \[14, 10, 12\] ) 3×4 DataFrame Row │ w a1 a2 a3 │ Int64 Int64 Int…

---

## [How to read a table from url](https://discourse.julialang.org/t/how-to-read-a-table-from-url/90985)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 8\
**Last updated:** [November 30, 2022, 5:44pm UTC](https://discourse.julialang.org/t/how-to-read-a-table-from-url/90985 "2022-11-30T17:44:08Z")

</div>

With pandas I can read a table into a dataframe, as follows: import pandas as pd dfs = pd.read\_html('http://stats.ioinformatics.org/countries/')#returns a list of tables df=dfs\[0\] df.head()#inspect header I searched fo…

---

## [The built-in complex division is unreasonably slow](https://discourse.julialang.org/t/the-built-in-complex-division-is-unreasonably-slow/91026)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 3\
**Last updated:** [November 30, 2022, 5:13pm UTC](https://discourse.julialang.org/t/the-built-in-complex-division-is-unreasonably-slow/91026 "2022-11-30T17:13:29Z")

</div>

@btime x/y setup=(x=rand(ComplexF64);y=rand(ComplexF64)); gives 9.853 ns (0 allocations: 0 bytes) while function frac(x::ComplexF64, y::ComplexF64) y2=y.re^2+y.im^2 return Complex((x.re\*y.re+x.im\*y.im)/y2, (x…

---

## [Dividing array by float: is multiplying with precalculated inverse worth it](https://discourse.julialang.org/t/dividing-array-by-float-is-multiplying-with-precalculated-inverse-worth-it/90943)

<div class="topic-metadata">

**Author:** [@tfiers](https://discourse.julialang.org/u/tfiers)\
**Replies:** 12\
**Last updated:** [November 30, 2022, 4:11pm UTC](https://discourse.julialang.org/t/dividing-array-by-float-is-multiplying-with-precalculated-inverse-worth-it/90943 "2022-11-30T16:11:17Z")

</div>

What is best, bigvec ./ some\_float() or bigvec .\* (1 / some\_float()) ? I looked at @code\_native to see if the first gets compiled to the second, but — from the little I understand of the output — it doesn’t seem so? …

---

## [Is Julia a modular programming language?](https://discourse.julialang.org/t/is-julia-a-modular-programming-language/91053)

<div class="topic-metadata">

**Author:** [@uje](https://discourse.julialang.org/u/uje)\
**Replies:** 2\
**Last updated:** [November 30, 2022, 3:52pm UTC](https://discourse.julialang.org/t/is-julia-a-modular-programming-language/91053 "2022-11-30T15:52:15Z")

</div>

From this article on modular programming from Wikipedia, under the Language support session, a list of languages were given that formally supports the module concepts. I was surprised to not see Julia included in that li…

---

## [How to share same legend for different plots?](https://discourse.julialang.org/t/how-to-share-same-legend-for-different-plots/91012)

<div class="topic-metadata">

**Author:** [@rongcuid](https://discourse.julialang.org/u/rongcuid)\
**Replies:** 5\
**Last updated:** [November 30, 2022, 2:52pm UTC](https://discourse.julialang.org/t/how-to-share-same-legend-for-different-plots/91012 "2022-11-30T14:52:45Z")

</div>

I have multiple plot!() statements used in a loop. I would like multiple plots to share the same legend, given a label, but Plots generate separate, identical legends for each plot command. For instance, as a minimal ex…

---

## [Makie LScene grid always on background](https://discourse.julialang.org/t/makie-lscene-grid-always-on-background/90995)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 8\
**Last updated:** [November 30, 2022, 2:13pm UTC](https://discourse.julialang.org/t/makie-lscene-grid-always-on-background/90995 "2022-11-30T14:13:26Z")

</div>

In Makie, is it possible to configure an LScene so that its grids behave like the ones of an Axis3 and remain in the background of the plot. I largely prefer the looks of the LScene grids for most of my plots (involving…

---

## [Loading a package that is not part of the dependnecies](https://discourse.julialang.org/t/loading-a-package-that-is-not-part-of-the-dependnecies/91011)

<div class="topic-metadata">

**Author:** [@Bugzaren](https://discourse.julialang.org/u/Bugzaren)\
**Replies:** 2\
**Last updated:** [November 30, 2022, 1:20pm UTC](https://discourse.julialang.org/t/loading-a-package-that-is-not-part-of-the-dependnecies/91011 "2022-11-30T13:20:04Z")

</div>

Hi, I have a feeling I’m going about his the wrong way, so I’m happy to be told how to do it properly. I have package MajoranaReps wants to load MathLink if it is installed. However, since MathLink uses proprietary sof…

---

## [In-place computation of Q (from QR decomposition)](https://discourse.julialang.org/t/in-place-computation-of-q-from-qr-decomposition/90881)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 35\
**Last updated:** [November 30, 2022, 12:58pm UTC](https://discourse.julialang.org/t/in-place-computation-of-q-from-qr-decomposition/90881 "2022-11-30T12:58:11Z")

</div>

I could use a fast computation of an orthonormalized basis to represent columns of a tall and narrow dense matrix. Taking advantage of an idle hour, I came up with this modified Gram-Schmidt: using LinearAlgebra funct…

---

## [Prompting for private key location when developing a private repo](https://discourse.julialang.org/t/prompting-for-private-key-location-when-developing-a-private-repo/91035)

<div class="topic-metadata">

**Author:** [@kai](https://discourse.julialang.org/u/kai)\
**Replies:** 2\
**Last updated:** [November 30, 2022, 12:32pm UTC](https://discourse.julialang.org/t/prompting-for-private-key-location-when-developing-a-private-repo/91035 "2022-11-30T12:32:52Z")

</div>

I’m trying to develop a private repo without success. Here is what I tried: First generated a id\_ed25519 key. Typing dev “git@github.com:username/mypackage.jl.git” gives Private key location for 'git@github.com': F…

---

## [Smaller float types?](https://discourse.julialang.org/t/smaller-float-types/91029)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 2\
**Last updated:** [November 30, 2022, 5:28am UTC](https://discourse.julialang.org/t/smaller-float-types/91029 "2022-11-30T05:28:33Z")

</div>

Where can I find small float types like 4-bit float? I don’t need high performance.

---

## [Get the name of the invoking module](https://discourse.julialang.org/t/get-the-name-of-the-invoking-module/22685)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 16\
**Last updated:** [November 30, 2022, 4:16am UTC](https://discourse.julialang.org/t/get-the-name-of-the-invoking-module/22685 "2022-11-30T04:16:02Z")

</div>

I have a user defined module which invokes a method defined in another module from a package. How can I get the name of the invoking user-defined module, so that my package can include/eval code back into the user’s modu…

---

## [How to force an error when can't parse value as date in CSV.jl?](https://discourse.julialang.org/t/how-to-force-an-error-when-cant-parse-value-as-date-in-csv-jl/91009)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 4\
**Last updated:** [November 30, 2022, 12:40am UTC](https://discourse.julialang.org/t/how-to-force-an-error-when-cant-parse-value-as-date-in-csv-jl/91009 "2022-11-30T00:40:40Z")

</div>

I’m trying to parse a column in my CSV file as dates, so I try to use CSV.File(..., dateformat=...) like this: df = CSV.File( IOBuffer("Date,Time\\n01/01/20, 10:10:10\\n01/01/20, 11:11:11\\ninvalid, 12:12:12"), dateforma…

---

## [Slow deletion loop on huge DataFrame](https://discourse.julialang.org/t/slow-deletion-loop-on-huge-dataframe/90970)

<div class="topic-metadata">

**Author:** [@Kryppi](https://discourse.julialang.org/u/Kryppi)\
**Replies:** 2\
**Last updated:** [November 29, 2022, 9:49pm UTC](https://discourse.julialang.org/t/slow-deletion-loop-on-huge-dataframe/90970 "2022-11-29T21:49:59Z")

</div>

I want to delete certain elements in an ordered DataFrame dim=(1.5 million,14). If the conditions for deletion are met, the code to check if the next element is also up for deletion (if the string in \[x,1\] is identical) …

---

## [C embedding interface called from multiple threads](https://discourse.julialang.org/t/c-embedding-interface-called-from-multiple-threads/18609)

<div class="topic-metadata">

**Author:** [@atell\_soundtheory](https://discourse.julialang.org/u/atell_soundtheory)\
**Replies:** 10\
**Last updated:** [November 29, 2022, 8:05pm UTC](https://discourse.julialang.org/t/c-embedding-interface-called-from-multiple-threads/18609 "2022-11-29T20:05:21Z")

</div>

I’ve spent a few days playing with embedding Julia into C++ signal processing code. My aim is to be able to quickly write prototype code in Julia that is then executed in a real-time audio host. The problem that I have …

---

## [How to Calculate the Integral of Floor function / ⌊x⌋ using SymPy or CalculusWithJulia Correctly?](https://discourse.julialang.org/t/how-to-calculate-the-integral-of-floor-function-x-using-sympy-or-calculuswithjulia-correctly/90998)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [November 29, 2022, 6:58pm UTC](https://discourse.julialang.org/t/how-to-calculate-the-integral-of-floor-function-x-using-sympy-or-calculuswithjulia-correctly/90998 "2022-11-29T18:58:45Z")

</div>

Hi all, I tried Sympy and the integral of a floor function can’t be calculated well. Here you go: The code to plot the floor function works well: using Plots,LaTeXStrings,Colors gr() f(x) = floor(x) x = -4:1:4 y = …

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

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