# Latest

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

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

**Page:** 1705

---

## [Error when using CuArrays in the VSCode Julia REPL](https://discourse.julialang.org/t/error-when-using-cuarrays-in-the-vscode-julia-repl/42197)

<div class="topic-metadata">

**Author:** [@natema](https://discourse.julialang.org/u/natema)\
**Replies:** 2\
**Last updated:** [June 28, 2020, 6:01pm UTC](https://discourse.julialang.org/t/error-when-using-cuarrays-in-the-vscode-julia-repl/42197 "2020-06-28T18:01:45Z")

</div>

If I run using CuArrays cu(rand(3)) I get 3-element CuArray{Float32,1,Nothing}: 0.59194994 0.6101809 0.8896474 but if I evaluate the two lines above from VSCode with the Julia extension I get the following error 1…

---

## [Whats the easiest way to set a ceiling to column values in a DataFrame](https://discourse.julialang.org/t/whats-the-easiest-way-to-set-a-ceiling-to-column-values-in-a-dataframe/42174)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 2\
**Last updated:** [June 28, 2020, 3:16pm UTC](https://discourse.julialang.org/t/whats-the-easiest-way-to-set-a-ceiling-to-column-values-in-a-dataframe/42174 "2020-06-28T15:16:21Z")

</div>

Hi how’s it going? I want to set a ceiling value to a column in my dataframe so that every value greater than 1.0 is equal to 1.0, everything else remains untouched. What’s the easiest way to do this?

---

## [Codify best practices for custom types](https://discourse.julialang.org/t/codify-best-practices-for-custom-types/42176)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 2\
**Last updated:** [June 28, 2020, 1:46pm UTC](https://discourse.julialang.org/t/codify-best-practices-for-custom-types/42176 "2020-06-28T13:46:15Z")

</div>

The announcement for CSV.jl v0.7 includes this new capability: Custom types can now be passed in the … types keyword …, fast parsing is supported for all Integer and AbstractFloat types; other custom types need …

---

## [Volcano - HPC workloads on Kubernetes](https://discourse.julialang.org/t/volcano-hpc-workloads-on-kubernetes/42187)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 1\
**Last updated:** [June 28, 2020, 11:05am UTC](https://discourse.julialang.org/t/volcano-hpc-workloads-on-kubernetes/42187 "2020-06-28T11:05:25Z")

</div>

I have not tried this but I like the concept. with Kubernetes being more and more deployed has anyone workedon Julia in such an environment? What do we think of the Volcano project as a way of running Julia in paralle…

---

## [Optimizing ODE parameters with constants](https://discourse.julialang.org/t/optimizing-ode-parameters-with-constants/42171)

<div class="topic-metadata">

**Author:** [@vaglino](https://discourse.julialang.org/u/vaglino)\
**Replies:** 6\
**Last updated:** [June 28, 2020, 10:25am UTC](https://discourse.julialang.org/t/optimizing-ode-parameters-with-constants/42171 "2020-06-28T10:25:32Z")

</div>

Hi, new to Julia here, I’m trying to optimize the parameters of an ode system, while keeping some parameter constant. Using the lotka-volterra as an example, function f(du,u,p,t) du\[1\] = dx = p\[1\]\*u\[1\] - u\[1\]\*u\[2\] …

---

## [Is python pandas faster than julia CSV?](https://discourse.julialang.org/t/is-python-pandas-faster-than-julia-csv/42183)

<div class="topic-metadata">

**Author:** [@hafez\_ahmad](https://discourse.julialang.org/u/hafez_ahmad)\
**Replies:** 3\
**Last updated:** [June 28, 2020, 5:23am UTC](https://discourse.julialang.org/t/is-python-pandas-faster-than-julia-csv/42183 "2020-06-28T05:23:24Z")

</div>

I have a CSV file which is 40.0kb. I tried both in pandas(python3.7) and CSV(julia1.4.2). I found python pandas is much faster than Julia CSV. however, Julia is faster than python in every case. why reading CSV is slower…

---

## [Distributed startup on large clusters](https://discourse.julialang.org/t/distributed-startup-on-large-clusters/42186)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 0\
**Last updated:** [June 28, 2020, 5:21am UTC](https://discourse.julialang.org/t/distributed-startup-on-large-clusters/42186 "2020-06-28T05:21:27Z")

</div>

I note that in Julia 1.5 IPV6 is supported for launch\_on\_machine(). Which is a good thing. https://github.com/JuliaLang/julia/pull/34430 This leads me to revive and old topic. Julia uses ssh connections to start proce…

---

## [Reading large-columned data using Feather.jl is too slow](https://discourse.julialang.org/t/reading-large-columned-data-using-feather-jl-is-too-slow/40377)

<div class="topic-metadata">

**Author:** [@Jean](https://discourse.julialang.org/u/Jean)\
**Replies:** 8\
**Last updated:** [June 28, 2020, 4:09am UTC](https://discourse.julialang.org/t/reading-large-columned-data-using-feather-jl-is-too-slow/40377 "2020-06-28T04:09:07Z")

</div>

Hi, I am working with large-columned data sets. One small example is the dimension of (1452, 66584) whose data size is about 2GB. When it converted to a feather format, its size was down to 778MB. The problem is Feathe…

---

## [Should I re-train the neural network if the desired final state is changed while solving optimal control problem?](https://discourse.julialang.org/t/should-i-re-train-the-neural-network-if-the-desired-final-state-is-changed-while-solving-optimal-control-problem/42166)

<div class="topic-metadata">

**Author:** [@XiaodongMa-MRI](https://discourse.julialang.org/u/XiaodongMa-MRI)\
**Replies:** 3\
**Last updated:** [June 28, 2020, 3:19am UTC](https://discourse.julialang.org/t/should-i-re-train-the-neural-network-if-the-desired-final-state-is-changed-while-solving-optimal-control-problem/42166 "2020-06-28T03:19:50Z")

</div>

Hi everyone, I have a very basic question about solving optimal control problems with universal differential equations. Say I want to find a control c(t) to achieve a certain final state u(T), and I can use neural netwo…

---

## [I keep getting worldage errors](https://discourse.julialang.org/t/i-keep-getting-worldage-errors/42177)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 2\
**Last updated:** [June 28, 2020, 2:50am UTC](https://discourse.julialang.org/t/i-keep-getting-worldage-errors/42177 "2020-06-28T02:50:08Z")

</div>

Last few days I’ve been getting random world age errors. Here is the code that triggers it now (the last line). using DataFrames using CSV using GLM using RCall using Plots #using PyPlot using Mamba using StatsPlots d…

---

## [Best choices for AMD 3970x when compiling from source](https://discourse.julialang.org/t/best-choices-for-amd-3970x-when-compiling-from-source/42180)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 0\
**Last updated:** [June 28, 2020, 2:50am UTC](https://discourse.julialang.org/t/best-choices-for-amd-3970x-when-compiling-from-source/42180 "2020-06-28T02:50:07Z")

</div>

When compiling from source there are various environment variables that can be set. For instance, there are various architecture options, thread counts, etcetera. What are the optimal choices for these for an AMD 3970x…

---

## [Memory allocation within loop](https://discourse.julialang.org/t/memory-allocation-within-loop/23999)

<div class="topic-metadata">

**Author:** [@drarnau](https://discourse.julialang.org/u/drarnau)\
**Replies:** 7\
**Last updated:** [June 28, 2020, 2:17am UTC](https://discourse.julialang.org/t/memory-allocation-within-loop/23999 "2020-06-28T02:17:32Z")

</div>

I have a for loop in which I create a function that I optimize, something like: using Interpolations, Optim function PolicyFunction() V = Array{Float64}(undef, 201, 40) n = Array{Float64}(undef, 201, 40) gr…

---

## [Using JuliaRegistrator: difficulty registering new releases](https://discourse.julialang.org/t/using-juliaregistrator-difficulty-registering-new-releases/42178)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 3\
**Last updated:** [June 28, 2020, 2:01am UTC](https://discourse.julialang.org/t/using-juliaregistrator-difficulty-registering-new-releases/42178 "2020-06-28T02:01:09Z")

</div>

My FunctionIntegrator.jl package is now officially in the General registry and I’m having a little difficulty with getting JuliaRegistrator to register a new release of my package. I created a comment on the commit tagge…

---

## [How do you push to production?](https://discourse.julialang.org/t/how-do-you-push-to-production/42175)

<div class="topic-metadata">

**Author:** [@MarkovChains](https://discourse.julialang.org/u/MarkovChains)\
**Replies:** 2\
**Last updated:** [June 27, 2020, 11:26pm UTC](https://discourse.julialang.org/t/how-do-you-push-to-production/42175 "2020-06-27T23:26:16Z")

</div>

So, when I write some algorithm for processing data in R, after testing, the act of pushing it to production is usually little more than basically having a pre-existing application or process call the R script. But, sin…

---

## [Compiler optimizations with broadcast or map](https://discourse.julialang.org/t/compiler-optimizations-with-broadcast-or-map/42119)

<div class="topic-metadata">

**Author:** [@kschurter](https://discourse.julialang.org/u/kschurter)\
**Replies:** 5\
**Last updated:** [June 27, 2020, 10:11pm UTC](https://discourse.julialang.org/t/compiler-optimizations-with-broadcast-or-map/42119 "2020-06-27T22:11:34Z")

</div>

I come to Julia from R and have never thought much about compilation or compiler optimizations. As far as I am aware, a simple optimization that a compiler can implement is to take an operation outside of a loop, e.g. d…

---

## [Gurobi on Julia 1.4](https://discourse.julialang.org/t/gurobi-on-julia-1-4/42131)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 9\
**Last updated:** [June 27, 2020, 8:35pm UTC](https://discourse.julialang.org/t/gurobi-on-julia-1-4/42131 "2020-06-27T20:35:48Z")

</div>

I’m trying to upgrade Julia to 1.4 from 1.3, but Gurobi package is giving me the following error. Could anybody confirm whether it’s related to my own setting or not? Any comments would be appreciated. I only have thre…

---

## [DataFrame groupby-aggregate strategy](https://discourse.julialang.org/t/dataframe-groupby-aggregate-strategy/42156)

<div class="topic-metadata">

**Author:** [@POKIN\_CHAN](https://discourse.julialang.org/u/POKIN_CHAN)\
**Replies:** 7\
**Last updated:** [June 27, 2020, 8:16pm UTC](https://discourse.julialang.org/t/dataframe-groupby-aggregate-strategy/42156 "2020-06-27T20:16:11Z")

</div>

Python: df.groupby(\["Z"\])\["A","B"\].agg({"A":"max"}) I want to groupby “Z” column and take the maximum of “A” in each group. Values of Column “B” is the row when A is max. I have used the following way but it is not t…

---

## [Turn code into function](https://discourse.julialang.org/t/turn-code-into-function/42147)

<div class="topic-metadata">

**Author:** [@colinclout12](https://discourse.julialang.org/u/colinclout12)\
**Replies:** 4\
**Last updated:** [June 27, 2020, 6:37pm UTC](https://discourse.julialang.org/t/turn-code-into-function/42147 "2020-06-27T18:37:59Z")

</div>

(Edited for code legibility.) I’m having some trouble transitioning from R to Julia. In R, I don’t have to worry if the argument for the function is a scalar or a vector, but in Julia, I get very different results if I …

---

## [Rewriting JuMP code in MathOptInterface](https://discourse.julialang.org/t/rewriting-jump-code-in-mathoptinterface/42061)

<div class="topic-metadata">

**Author:** [@GeneralPoxter](https://discourse.julialang.org/u/GeneralPoxter)\
**Replies:** 5\
**Last updated:** [June 27, 2020, 4:59pm UTC](https://discourse.julialang.org/t/rewriting-jump-code-in-mathoptinterface/42061 "2020-06-27T16:59:32Z")

</div>

Say I wanted to add a variable x which represents an m x n matrix whose elements are constrianed. In JuMP, the code would simply be: @variable(model, 0 \<= x\[i=1:m, j=1:n\] \<= 1) However, I am not sure how to translate …

---

## [Combine a "plot" object with a "scatter" object in an animation](https://discourse.julialang.org/t/combine-a-plot-object-with-a-scatter-object-in-an-animation/42140)

<div class="topic-metadata">

**Author:** [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Replies:** 3\
**Last updated:** [June 27, 2020, 2:22pm UTC](https://discourse.julialang.org/t/combine-a-plot-object-with-a-scatter-object-in-an-animation/42140 "2020-06-27T14:22:26Z")

</div>

I’m creating an animation by combining multiple scatter plots (using Animation() and frame()). It all works fine. But I would like my scatter plots to be overlaid on a plot that shows the trajectories I expect the partic…

---

## [Improvement of string search in julia base](https://discourse.julialang.org/t/improvement-of-string-search-in-julia-base/41945)

<div class="topic-metadata">

**Author:** [@rryi](https://discourse.julialang.org/u/rryi)\
**Replies:** 5\
**Last updated:** [June 27, 2020, 1:48pm UTC](https://discourse.julialang.org/t/improvement-of-string-search-in-julia-base/41945 "2020-06-27T13:48:25Z")

</div>

I would like to contribute some performance optimization of the julia base search function: \_searchindex. I have prepared a benchmark package and experiments with several code variants here: https://github.com/rryi/Sea…

---

## [How to crop or zoom into a plot area](https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151)

<div class="topic-metadata">

**Author:** [@Alireza\_Ghavaminia](https://discourse.julialang.org/u/Alireza_Ghavaminia)\
**Replies:** 4\
**Last updated:** [June 27, 2020, 1:14pm UTC](https://discourse.julialang.org/t/how-to-crop-or-zoom-into-a-plot-area/42151 "2020-06-27T13:14:44Z")

</div>

Hello, I have a polar plot, and I want to zoom into one section of it, How can I do that. using Plots x = \[0,pi/6,pi/4,pi/3,pi/2\] # theta y = \[0,0.1, 0.2, 0.3, 0.4\] # r p = plot(x,y,axis=false,legend=false,proj =:pola…

---

## [Function parameter speculation in runtime](https://discourse.julialang.org/t/function-parameter-speculation-in-runtime/41523)

<div class="topic-metadata">

**Author:** [@dinskid](https://discourse.julialang.org/u/dinskid)\
**Replies:** 3\
**Last updated:** [June 27, 2020, 11:50am UTC](https://discourse.julialang.org/t/function-parameter-speculation-in-runtime/41523 "2020-06-27T11:50:57Z")

</div>

I need a way to imitate the functionality of the inspect module from python. I want to know the list of parameters of a functions, check if there are default values or not, and check if it accepts kwargs or not. Sample…

---

## [Operator equivalent to pipeline function?](https://discourse.julialang.org/t/operator-equivalent-to-pipeline-function/42137)

<div class="topic-metadata">

**Author:** [@derekmahar](https://discourse.julialang.org/u/derekmahar)\
**Replies:** 1\
**Last updated:** [June 27, 2020, 11:44am UTC](https://discourse.julialang.org/t/operator-equivalent-to-pipeline-function/42137 "2020-06-27T11:44:46Z")

</div>

Does there exist an operator that is equivalent to the pipeline function for creating external command chains?

---

## [Cryptic error message in constructing an NTuple](https://discourse.julialang.org/t/cryptic-error-message-in-constructing-an-ntuple/42149)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 4\
**Last updated:** [June 27, 2020, 11:16am UTC](https://discourse.julialang.org/t/cryptic-error-message-in-constructing-an-ntuple/42149 "2020-06-27T11:16:41Z")

</div>

I’m on Julia 1.4.2. This works julia\> NTuple{1}(3) (3,) This doesn’t, and doesn’t say why julia\> NTuple(3) ERROR: UndefVarError: E not defined Stacktrace: \[1\] \_totuple(::Type{Tuple{Vararg{T,N}} where T where N}, ::…

---

## [Extra allocation when trying to reuse pre-allocated vector](https://discourse.julialang.org/t/extra-allocation-when-trying-to-reuse-pre-allocated-vector/42112)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 6\
**Last updated:** [June 27, 2020, 9:13am UTC](https://discourse.julialang.org/t/extra-allocation-when-trying-to-reuse-pre-allocated-vector/42112 "2020-06-27T09:13:45Z")

</div>

Hi, I am trying to generate data for logistic regression y (which is {0, 1}) from X and β. I already allocate the space for y and then wrote function to computing the same in two different ways. I then use TimerOutputs…

---

## [Number of months between two dates](https://discourse.julialang.org/t/number-of-months-between-two-dates/42128)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 2\
**Last updated:** [June 27, 2020, 8:25am UTC](https://discourse.julialang.org/t/number-of-months-between-two-dates/42128 "2020-06-27T08:25:38Z")

</div>

Is there a convenient way to calculate the number of months between two dates? I can’t seem to find anything in the Dates package.

---

## [Colouring the output of println](https://discourse.julialang.org/t/colouring-the-output-of-println/42136)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 2\
**Last updated:** [June 27, 2020, 7:26am UTC](https://discourse.julialang.org/t/colouring-the-output-of-println/42136 "2020-06-27T07:26:34Z")

</div>

My new package’s tests include println lines to explain the tests being run so that their output is more helpful. It would be nice to be able to distinguish println line outputs from the other outputs using colour coding…

---

## [VS Code Julia:Execute File workflow](https://discourse.julialang.org/t/vs-code-julia-execute-file-workflow/42145)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 2\
**Last updated:** [June 27, 2020, 6:19am UTC](https://discourse.julialang.org/t/vs-code-julia-execute-file-workflow/42145 "2020-06-27T06:19:22Z")

</div>

I have this test file: include("simc.jl") using .Simc push!(Base.DL\_LOAD\_PATH, pwd()) function f() println(say42()) end f() The library I’m loading is defective, but when I run the whole file with Julia:Execute Fil…

---

## [Find n smallest values in an array](https://discourse.julialang.org/t/find-n-smallest-values-in-an-array/42125)

<div class="topic-metadata">

**Author:** [@Vasily\_Ilin](https://discourse.julialang.org/u/Vasily_Ilin)\
**Replies:** 5\
**Last updated:** [June 27, 2020, 5:48am UTC](https://discourse.julialang.org/t/find-n-smallest-values-in-an-array/42125 "2020-06-27T05:48:32Z")

</div>

Given an array and an integer n, I would like to find n smallest elements of the array without sorting the whole array. Is there a pre-built function for this?

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

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