# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1115

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

**Page:** 1116

---

## [Why does this matrix increment allocate?](https://discourse.julialang.org/t/why-does-this-matrix-increment-allocate/76796)

<div class="topic-metadata">

**Author:** [@freeman](https://discourse.julialang.org/u/freeman)\
**Replies:** 7\
**Last updated:** [February 21, 2022, 4:20am UTC](https://discourse.julialang.org/t/why-does-this-matrix-increment-allocate/76796 "2022-02-21T04:20:16Z")

</div>

module somemodule using BenchmarkTools struct MyType A::AbstractMatrix B::AbstractMatrix end myinc(A::AbstractMatrix, B::AbstractMatrix) = A .+= B mytypeinc(t::MyType, B::AbstractMatrix) = t.A .+= B mytypeinc2…

---

## [Setting up Dict example puzzled by syntax and functionality](https://discourse.julialang.org/t/setting-up-dict-example-puzzled-by-syntax-and-functionality/76823)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 16\
**Last updated:** [February 21, 2022, 2:43am UTC](https://discourse.julialang.org/t/setting-up-dict-example-puzzled-by-syntax-and-functionality/76823 "2022-02-21T02:43:22Z")

</div>

Hi all noob here. I am SLOWLY learning how to code properly in julia and trying NOT to bring my python baggage with me. I’ve set myself a high level goal and sub divided it into tasks. So I wanted to read a csv and put…

---

## [This post claims that Julia is still 4-5 times slower than cython](https://discourse.julialang.org/t/this-post-claims-that-julia-is-still-4-5-times-slower-than-cython/76735)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 38\
**Last updated:** [February 21, 2022, 1:56am UTC](https://discourse.julialang.org/t/this-post-claims-that-julia-is-still-4-5-times-slower-than-cython/76735 "2022-02-21T01:56:46Z")

</div>

https://jochenschroeder.com/blog/articles/DSP\_with\_Python2/ Just posting here in case anyone’s interested in having a look.

---

## [Fail to build \`PyCall\` in Julia 1.6.3](https://discourse.julialang.org/t/fail-to-build-pycall-in-julia-1-6-3/69698)

<div class="topic-metadata">

**Author:** [@caimiao0714](https://discourse.julialang.org/u/caimiao0714)\
**Replies:** 5\
**Last updated:** [February 21, 2022, 12:52am UTC](https://discourse.julialang.org/t/fail-to-build-pycall-in-julia-1-6-3/69698 "2022-02-21T00:52:50Z")

</div>

Hi everyone, I am a beginner in Julia and I’m trying to install the PyCall package in Julia v1.6.3 (I’m using Jupyter notebook) on Windows 10. However, I encounter the following error messages and I cannot find any answ…

---

## [How to clean/filter/remove wrong data from DataFrame](https://discourse.julialang.org/t/how-to-clean-filter-remove-wrong-data-from-dataframe/76797)

<div class="topic-metadata">

**Author:** [@likzew](https://discourse.julialang.org/u/likzew)\
**Replies:** 13\
**Last updated:** [February 21, 2022, 12:52am UTC](https://discourse.julialang.org/t/how-to-clean-filter-remove-wrong-data-from-dataframe/76797 "2022-02-21T00:52:19Z")

</div>

Hi, What’s the best way to fix the anomaly in column c? test = DataFrame(a = 1:5, b = rand(5), c=\[2,5,5,"%42,,",5\])

---

## [I translated Peter Shirley's Raytracer to Julia. C++ 1min -\> Julia 2m30s -\> 15s (@threads)](https://discourse.julialang.org/t/i-translated-peter-shirleys-raytracer-to-julia-c-1min-julia-2m30s-15s-threads/75671)

<div class="topic-metadata">

**Author:** [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Replies:** 27\
**Last updated:** [February 21, 2022, 12:15am UTC](https://discourse.julialang.org/t/i-translated-peter-shirleys-raytracer-to-julia-c-1min-julia-2m30s-15s-threads/75671 "2022-02-21T00:15:18Z")

</div>

Hi, I like raytracing and there are a nice set of books https://github.com/RayTracing/raytracing.github.io so now I’m a bit better at Julia, I transcoded the C++ into Julia and got some nice speedups. The single thre…

---

## [Y-axis scale in histogram](https://discourse.julialang.org/t/y-axis-scale-in-histogram/76819)

<div class="topic-metadata">

**Author:** [@met-j](https://discourse.julialang.org/u/met-j)\
**Replies:** 3\
**Last updated:** [February 20, 2022, 9:44pm UTC](https://discourse.julialang.org/t/y-axis-scale-in-histogram/76819 "2022-02-20T21:44:13Z")

</div>

How can I scale the y axis ticks in a histogram? Is there a way to access the counts in a histogram from dispatching the plot function with st=:hist? In my case I have counts in between 1 000 and a few 10 000s. I woul…

---

## [Dataframe destructors](https://discourse.julialang.org/t/dataframe-destructors/76822)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 2\
**Last updated:** [February 20, 2022, 9:34pm UTC](https://discourse.julialang.org/t/dataframe-destructors/76822 "2022-02-20T21:34:02Z")

</div>

What is the best (simple/efficient) way to transform a dataframe into a namedtuple of vectors? and What is the best (simple/efficient) way to transform a dataframe into a vector of namedtuples?

---

## [SXTTools package](https://discourse.julialang.org/t/sxttools-package/76818)

<div class="topic-metadata">

**Author:** [@Arnab\_Kundu](https://discourse.julialang.org/u/Arnab_Kundu)\
**Replies:** 1\
**Last updated:** [February 20, 2022, 8:27pm UTC](https://discourse.julialang.org/t/sxttools-package/76818 "2022-02-20T20:27:48Z")

</div>

I am unable to download SXTTools package in Julia.

---

## [A question on broadcasting fft for vectors of matrices](https://discourse.julialang.org/t/a-question-on-broadcasting-fft-for-vectors-of-matrices/76806)

<div class="topic-metadata">

**Author:** [@andreasvarga](https://discourse.julialang.org/u/andreasvarga)\
**Replies:** 9\
**Last updated:** [February 20, 2022, 7:36pm UTC](https://discourse.julialang.org/t/a-question-on-broadcasting-fft-for-vectors-of-matrices/76806 "2022-02-20T19:36:18Z")

</div>

In the following I am creating a 3-vector of 2x2 matrices M: M = \[ rand(2,2) for i in 1:3\] Is it any easy compact way to extract/view (e.g., for the purpose of broadcasting), say, the vector of \[1,1\] elements of the th…

---

## [Julia's equivalent of Python's importlib.import\_module(path)](https://discourse.julialang.org/t/julias-equivalent-of-pythons-importlib-import-module-path/76746)

<div class="topic-metadata">

**Author:** [@lodo1995](https://discourse.julialang.org/u/lodo1995)\
**Replies:** 7\
**Last updated:** [February 20, 2022, 1:52pm UTC](https://discourse.julialang.org/t/julias-equivalent-of-pythons-importlib-import-module-path/76746 "2022-02-20T13:52:13Z")

</div>

I come from Python and I very often find myself loading code dynamically based on filesystem paths provided by the user (typically through command line). Typically they are either plugin code or configuration files (I li…

---

## [How is it possible to show "links/alingments" between 2 sets of points using PGFPlotsX.jl?](https://discourse.julialang.org/t/how-is-it-possible-to-show-links-alingments-between-2-sets-of-points-using-pgfplotsx-jl/76776)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 1\
**Last updated:** [February 20, 2022, 11:36am UTC](https://discourse.julialang.org/t/how-is-it-possible-to-show-links-alingments-between-2-sets-of-points-using-pgfplotsx-jl/76776 "2022-02-20T11:36:42Z")

</div>

I am working on point cloud alignment model and want to show the initial alignment vs the final alignment on a 2d dataset. I also want to show the alignment between point pairs just for curiosity. For demonstration purp…

---

## [Problems using meshgrid to plot a surface in an attempt to visualize feature mapping and SVM](https://discourse.julialang.org/t/problems-using-meshgrid-to-plot-a-surface-in-an-attempt-to-visualize-feature-mapping-and-svm/76792)

<div class="topic-metadata">

**Author:** [@Jasper\_De\_Landsheere](https://discourse.julialang.org/u/Jasper_De_Landsheere)\
**Replies:** 0\
**Last updated:** [February 20, 2022, 10:58am UTC](https://discourse.julialang.org/t/problems-using-meshgrid-to-plot-a-surface-in-an-attempt-to-visualize-feature-mapping-and-svm/76792 "2022-02-20T10:58:15Z")

</div>

Hi all, I am working on a little project using toy data to visualize what happens when you map data to a higher feature space and perform SVM (Support Vector Machine) in this higher space. With the obtained set of weigh…

---

## [Is there a good implementation of a BiDict (invertable Dict)](https://discourse.julialang.org/t/is-there-a-good-implementation-of-a-bidict-invertable-dict/76789)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 2\
**Last updated:** [February 20, 2022, 10:33am UTC](https://discourse.julialang.org/t/is-there-a-good-implementation-of-a-bidict-invertable-dict/76789 "2022-02-20T10:33:43Z")

</div>

I need a lookup table that works in both directions for saving and loading a custom file. Therefore I thought a dictionary that also used the values as keys might be handy. Is there a good implementation for this? My …

---

## [Cross join DataFrames](https://discourse.julialang.org/t/cross-join-dataframes/76787)

<div class="topic-metadata">

**Author:** [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Replies:** 1\
**Last updated:** [February 20, 2022, 9:13am UTC](https://discourse.julialang.org/t/cross-join-dataframes/76787 "2022-02-20T09:13:40Z")

</div>

How can I cross join two dataframes A and B? In other words, combine every row in A with every row in B? I prefer not to do tricks like adding temporary columns.

---

## ["Assignment form" function definition following \`for\` keyword](https://discourse.julialang.org/t/assignment-form-function-definition-following-for-keyword/76786)

<div class="topic-metadata">

**Author:** [@Hiroharu\_Sugawara](https://discourse.julialang.org/u/Hiroharu_Sugawara)\
**Replies:** 3\
**Last updated:** [February 20, 2022, 9:07am UTC](https://discourse.julialang.org/t/assignment-form-function-definition-following-for-keyword/76786 "2022-02-20T09:07:44Z")

</div>

Hi folks. I find it weird that the following code works: julia\> begin for f(x)=2 @show f(1) @show typeof(f) end end f(1) = 2 typeof(f) = var"#f#1"{Int64} I su…

---

## [Drawing a surface boundary around scattered points](https://discourse.julialang.org/t/drawing-a-surface-boundary-around-scattered-points/76785)

<div class="topic-metadata">

**Author:** [@gojira](https://discourse.julialang.org/u/gojira)\
**Replies:** 3\
**Last updated:** [February 20, 2022, 7:43am UTC](https://discourse.julialang.org/t/drawing-a-surface-boundary-around-scattered-points/76785 "2022-02-20T07:43:40Z")

</div>

I was wondering if there was a way to collect all of the boundary points to a 3D scatter plot? All of the points are generated randomly. I guess more specifically if I have a structure that has a field with 100 data poin…

---

## [How to convert period in milisecond to minutes / seconds , hour etc](https://discourse.julialang.org/t/how-to-convert-period-in-milisecond-to-minutes-seconds-hour-etc/2423)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 15\
**Last updated:** [February 17, 2022, 1:25pm UTC](https://discourse.julialang.org/t/how-to-convert-period-in-milisecond-to-minutes-seconds-hour-etc/2423 "2022-02-17T13:25:47Z")

</div>

How to convert period in milisecond to minutes / seconds , hour etc julia 0.5.0 julia\> delta=events\[1,2\].-events\[1:1\] 75631000 (miliseconds) julia\> convert(Dates.Minute,delta) 75631000 minutes ??? WRONG Paul

---

## [Saving and retriving information to files inside a big for loop](https://discourse.julialang.org/t/saving-and-retriving-information-to-files-inside-a-big-for-loop/76783)

<div class="topic-metadata">

**Author:** [@luisgarciapuente](https://discourse.julialang.org/u/luisgarciapuente)\
**Replies:** 1\
**Last updated:** [February 20, 2022, 5:59am UTC](https://discourse.julialang.org/t/saving-and-retriving-information-to-files-inside-a-big-for-loop/76783 "2022-02-20T05:59:20Z")

</div>

I have the following code running inside a loop that will run about 100 times but each iteration may take several hours. open(string(“tree\_”, tree, “.txt”), “a”) do file println(file, (i, tree, model, length(sols), fib…

---

## [LoadError: MethodError: no method matching abs2(::Expression)](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-abs2-expression/76764)

<div class="topic-metadata">

**Author:** [@luisgarciapuente](https://discourse.julialang.org/u/luisgarciapuente)\
**Replies:** 10\
**Last updated:** [February 20, 2022, 4:39am UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-abs2-expression/76764 "2022-02-20T04:39:12Z")

</div>

I am new to Julia. My collaborators sent me some code that do run for them but I cannot run it myself. We cannot figure out what is wrong since the code does run for them. I tried two different computers, and versions 1.…

---

## [Two versions of Julia installed. How to use the latest as default when executing a code?](https://discourse.julialang.org/t/two-versions-of-julia-installed-how-to-use-the-latest-as-default-when-executing-a-code/76703)

<div class="topic-metadata">

**Author:** [@munizalex](https://discourse.julialang.org/u/munizalex)\
**Replies:** 13\
**Last updated:** [February 20, 2022, 3:43am UTC](https://discourse.julialang.org/t/two-versions-of-julia-installed-how-to-use-the-latest-as-default-when-executing-a-code/76703 "2022-02-20T03:43:28Z")

</div>

Here, finally installed everything I need on my new fresh Fedora 35 install, and I made a mistake to install LTS version and fedora repo of Julia. How do I set the latest as default, like in the terminal run “julia 1.7.1…

---

## [\[Dates\] Division of Periods](https://discourse.julialang.org/t/dates-division-of-periods/76779)

<div class="topic-metadata">

**Author:** [@Vyacheslav\_Vorobyov](https://discourse.julialang.org/u/Vyacheslav_Vorobyov)\
**Replies:** 5\
**Last updated:** [February 20, 2022, 1:56am UTC](https://discourse.julialang.org/t/dates-division-of-periods/76779 "2022-02-20T01:56:23Z")

</div>

Hi, I tried to use Dates module and divide Millseconds on Minutes and error happen. Why operation didn’t dispatch to method " /(::P, ::P) where P\<:Period" ? Julia Version 1.6.5 julia\> using Dates julia\> Dates.Millise…

---

## [Lag vector by group using another vector as the grouping variable](https://discourse.julialang.org/t/lag-vector-by-group-using-another-vector-as-the-grouping-variable/76766)

<div class="topic-metadata">

**Author:** [@rubaiyat](https://discourse.julialang.org/u/rubaiyat)\
**Replies:** 4\
**Last updated:** [February 20, 2022, 1:46am UTC](https://discourse.julialang.org/t/lag-vector-by-group-using-another-vector-as-the-grouping-variable/76766 "2022-02-20T01:46:55Z")

</div>

Hello everyone, I was wondering if it were possible to lag a vector by group, when the grouping variable is a separate vector. Here’s a minimum working example: firm\_id = \["A", "A", "A", "A", "B", "B", "B", "B"\] reve…

---

## [Easiest way to "compile" program to single file](https://discourse.julialang.org/t/easiest-way-to-compile-program-to-single-file/76616)

<div class="topic-metadata">

**Author:** [@peteole](https://discourse.julialang.org/u/peteole)\
**Replies:** 6\
**Last updated:** [February 19, 2022, 10:38pm UTC](https://discourse.julialang.org/t/easiest-way-to-compile-program-to-single-file/76616 "2022-02-19T22:38:23Z")

</div>

Hi, I have the following issue: I want to use julia at a coding competition: https://codingcompetitions.withgoogle.com/kickstart It works fine for old problems. However there is the issue that sometimes I want to use …

---

## [Const vs zero argument function](https://discourse.julialang.org/t/const-vs-zero-argument-function/76770)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 4\
**Last updated:** [February 19, 2022, 9:19pm UTC](https://discourse.julialang.org/t/const-vs-zero-argument-function/76770 "2022-02-19T21:19:57Z")

</div>

In Julia, we have both trivial zero argument functions and constants a() = 7 const A = 8 Both support constant propagation: f(x) = x+a() g(x) = x+A @code\_llvm f(0) ; @ REPL\[3\]:1 within \`f\` define i64 @julia\_f\_140(i64…

---

## [Issues implementing a simple Stan example](https://discourse.julialang.org/t/issues-implementing-a-simple-stan-example/75985)

<div class="topic-metadata">

**Author:** [@charperflow](https://discourse.julialang.org/u/charperflow)\
**Replies:** 33\
**Last updated:** [February 19, 2022, 9:14pm UTC](https://discourse.julialang.org/t/issues-implementing-a-simple-stan-example/75985 "2022-02-19T21:14:46Z")

</div>

Hi everyone, I am following the example posted here: https://github.com/StanJulia/StanSample.jl/blob/master/example/keyword\_bernoulli.jl When I get to the following line of code I get an error: sm = SampleModel("test…

---

## [What is command to convert a jl file to an ipynb file using Literate.jl](https://discourse.julialang.org/t/what-is-command-to-convert-a-jl-file-to-an-ipynb-file-using-literate-jl/57780)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 6\
**Last updated:** [February 19, 2022, 9:11pm UTC](https://discourse.julialang.org/t/what-is-command-to-convert-a-jl-file-to-an-ipynb-file-using-literate-jl/57780 "2022-02-19T21:11:07Z")

</div>

Sorry, I can’t find anywhere the command to convert a file.jl into a file.ipynb using Literate.jl. How is it done?

---

## [Index of a grid](https://discourse.julialang.org/t/index-of-a-grid/76771)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 8\
**Last updated:** [February 19, 2022, 7:53pm UTC](https://discourse.julialang.org/t/index-of-a-grid/76771 "2022-02-19T19:53:57Z")

</div>

My goal is to find the index of a grid that meet certain criteria. For example, I have an X Y that is meshgridded together using the below function: X, Y = ndgrid(\[-180:1:180\], \[-90:1:90\]; So my Y will be like a matrix…

---

## [Seeking Tips for Solving an ODE with DifferentialEquations](https://discourse.julialang.org/t/seeking-tips-for-solving-an-ode-with-differentialequations/76311)

<div class="topic-metadata">

**Author:** [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Replies:** 4\
**Last updated:** [February 19, 2022, 4:45pm UTC](https://discourse.julialang.org/t/seeking-tips-for-solving-an-ode-with-differentialequations/76311 "2022-02-19T16:45:33Z")

</div>

Our package QuantumAnnealing solves ODEs that arise in design of quantum annealing algorithms. The package includes two solution methods simulate (a hand crafted solution) and simulate\_de (a generic solution approach usi…

---

## [Recode multiple columns in DataFrame as integer](https://discourse.julialang.org/t/recode-multiple-columns-in-dataframe-as-integer/76699)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 8\
**Last updated:** [February 19, 2022, 10:06am UTC](https://discourse.julialang.org/t/recode-multiple-columns-in-dataframe-as-integer/76699 "2022-02-19T10:06:02Z")

</div>

Hi all, I want to recode symbols in a DataFrame as integers so I can use confusmat to create a confusion matrix. Here is what my DataFrame looks like: using DataFrames df = DataFrame(x = \[:a,:a,:b,:c,:c\], y = \[:b,:b,…

[Previous page](https://discourse.julialang.org/latest.md?page=1114)

[Next page](https://discourse.julialang.org/latest.md?page=1116)
