Reuse results from @example blocks
I’m writing some documentation using Documenter.jl and would like to create a sort of follow along guide (like a jupyter notebook). Currently, I’m using @example blocks for showing the code and the...
View ArticleIs there a way to fill a dataframe with values from a smaller dataframe?
I was hoping to be able to fill a larger DataFrame with the values of a smaller one using fill() but it doesn’t work this way. I can create a new DataFrame using vcat but was hoping for a better...
View ArticleRun(cmd) manual examples throw error
In the examples from the manual section “Running External Programs”, I can’t seem to get the examples to work on my machine… cmd = `echo hello` run(cmd) Here is the error: ERROR: IOError: could not...
View ArticleBest coding of homogeneous types
Hi, I have a code where there are several Float64 type variables, which I would like to group as: Group1: H_0, Omega_m0, Omega_Lambda0 Group2: Omega_geom0, A, z_f, z_t These groups, Group1 and Group2,...
View Article%%writefile in Julia
In Python, I always used %%writefile myfile.py in Jupyter notebooks when I wanted to export the code coming after it. How do I do that in Julia? 2 posts - 1 participant Read full topic
View ArticleBest way for comparisons in one line to avoid undesired effects of operator...
I am wondering how to write best a simple if comparison expression else expression end in one line. julia> if 7+2<10 3 else 0 end 3 works as desired. If the comparison is true, give a value 3...
View ArticlePlotlyjs or gr
Is plotlyjs a separate pkg or it is a backend in plots as gr? 6 posts - 3 participants Read full topic
View ArticleHelp with deprecation warnings in tests
I would like to test that a function emits a deprecation warning, but I keep getting errors. Can someone please help me get the right syntax? Here is an MWE julia> function foo() Base.depwarn("use...
View Article[Help] Plot/export of solutions from PDE
Hello, I’m quite new to Julia. I’m having a problem with “plot” and “exporting”. Can anyone give help for a newbie? Using VoronoiFVM for one-dimensional PDE, the solution is expressed as...
View ArticleConverting well structure VBA code, with multiple sub-routine call, to Julia
I have been using Julia for about a week using Vscode as my IDE. Simple examples not problems. My task at hand it to convert well structure code (in VBA) to Julia - I am solving a system of 130 ODE’s...
View ArticleGradients of a simple function using ForwardDiff yields errorenous results? -...
I would like to calculate the gradient of a simple function using FowardDiff.gradient, but I have been encountering problems, where I have gotten different answers from code that should seemingly be...
View ArticleMaking a Function FASTER!
Hi everyone. I am new to Julia. Just started a week ago. I am trying to do a Monte Carlo kind of code and these functions are a part of it. function GetTime(ray0, F_Sp) Snodes=zeros(size(ray0,1),1);...
View ArticleModelling a NeuralODE with external excitation using DiffEqFlux.jl
Hello everyone, following this (https://julialang.org/blog/2019/01/fluxdiffeq/) introduction to DiffEqFlux.jl I’ve set up a slightly modified example (I’m using a different diff. equation). My code...
View ArticleHow to make top title in group layout plot?
Hello! I have this plot: image881×635 42.2 KB How would I make a title above both of them called “My Plot”? These are the basic commands I use: l = @layout grid(2,1) pall = plot(p1,p2, layout =...
View ArticleChange layering of plots?
Hi! Using the plotting tools in Julia, am I able to rearrange which line overlaps another line? Suppose I have a case like this: image1168×359 33.9 KB I want to plot the black vertical lines first, so...
View ArticleCan't use clipboard() out REPL
Hey guys! I’m having problems using clipboard() outside of the REPL… If i make a clip.jl file with: x = “hi” clipboard(x) I get the message: ERROR LoadError: UndefVarError: clipboard not defined Also...
View ArticleStudy of robust optimization
I am studying about robust optimization models in Julia, I found some good examples but they are still not clear to me. Could someone help me by putting a simple example on the reformulation method...
View ArticleForce installation of a pkg
Hello, im using julia 1.4.2, i have sucefully installed and used ReinforcementLearning.jl then i decided to install Pkg.add("POMDPs"); Pkg.add("QMDP") which caused: Updating `~/x/Project.toml`...
View ArticleBayesian estimation with Multinomial Likelihood and Dirichlet prior
I’m trying to fit a parasite dynamic model to some experimental data using Turing.jl, but I’m having some trouble specifying the prior variance, σ. It works fine if I use an InverseGamma distribution...
View ArticleCompiling error in VScode
Hello! I recently installed the Julia extension on my Visual Studio, I already configured the executablePath to the .exe location in my Appdata, however after getting no errors, when I compile a...
View Article