How to change `annotate!` backgroud color?
I’m trying to use Plots and annotate function to plot a numerical value onto the line. plotly() plot(sin) annotate!(0, sin(0), text("0")) It works not bad. Furthermore, I want to put a text on the...
View ArticleHow to use multiple threads (julia > 1.3) in a for loop saving results in a...
As I needed quite a few time to learn how to use the new @spawn in Julia >= 1.3, here is an example on how to use threads on a function that produces something, saving the results to a vector...
View ArticleArgParseSettings() and special characters
I would like to include a special character within the text for the epilog. In the documentation for ArgParseSettings, it is mentioned that one can manually control spaces using ‘\ua0’. So, I figured...
View ArticleGet JuliaDB.loadtable to parse all columns in CSVs as String
I’m using Julia 1.4. I want to use JuliaDB.jl, specifically, to read a bunch of CSVs and combine them into one big DataFrame. Here’s the issue: When reading the CSVs, I want all columns to be parsed...
View ArticleSomething like C++ static declaration for functions in Julia?
Hi everyone! I was trying to implement a few simple algorithms in Julia, and now have a question about declaring functions static. Minimal example: function myfun(u::Vector{Float64},...
View ArticleHow to get dependency information for "to-be-added" packages?
Background: Like many, I have the issue that my work PC is behind a corporate firewall and I am not personally able to create a proxy (not an admin or in cybersec). Additionally, I have to submit...
View ArticleHow to access columns in a Vector{Array{Float64,2}}
I have a Vector{Array{Float64,2}} that I want to access columns from, but I don’t know how. It is generated via comprehension. Does it need to be turned into a DataFrame? If so, how? When I try df1 =...
View ArticleHow to efficiently do a martix multiplication?
Hello! I’m a Julia beginner and I’d like to know is there any way to make this code more memory efficient? function myAllocTest() p = rand(50,1); A = rand(50,50); W = similar(A); D = similar(A); m =...
View ArticleJuno, how to go to the definition of a dependency package
Hi, I would like to dive into the source of the dependency package by [Go to definition] of Juno while coding and debugging, which currently seems not working on my environment. Is it possible to do...
View ArticleAll Vectors with Entries from a Given Array
Hey! I have the following question: Given an array of numbers, say A = [0, 1, 3], what is the best way to get all vectors (arrays) of fix length with entries from A? So in other words, I want to get...
View ArticleHow to discretize and solve a 3D Poisson Equation with Dirichlet boundary...
I love the following example of solving a 1D Poisson equation with DiffEqOperators. However , I struggle to do the analog 3D example. Can somebody indicate me the right steps? using DiffEqOperators,...
View ArticleTidying data: DataFrame
Hello, I have been trying to do some basic Data Analysis with Julia DataFrames and cannot find a way to tidy my data. I would like to simply use values of one of the columns to group df based on them...
View ArticleLightgraph + ModelToolkit optimization
Hi, I finally got an SIR model to work with SIR combined with ModelToolkit. Here is the code: using Plots using DataFrames using ModelingToolkit using DiffEqBase using DiffEqJump using LightGraphs...
View ArticleJulia Build with MKL Help
I am trying to build Julia on a computer that is new to me, using MKL (which I’ve never used before so maybe this isn’t the problem here). I ran source /path/to/intel/bin/compilervars.sh intel64 and...
View Article@__LINE__ etc in another macro
How do I do this … verbosity_tags = [....] macro noise(tag, args...) return :( if $tag in verbosity_tags; println("$(basename(@__FILE__)): $(@__LINE__): ", $(esc.(args)...)); end ) end in such a way...
View ArticleHow to find the intercept of two functions?
How do I find the intercept of two functions? I thought it would be something simple like findall(in(a), b) but this gives me Vector{Int64} with 0 elements MWE attack_max2 = 0.90 attack_min2 = 0.52...
View ArticleInference using HMC on a Hidden Markov Model
I am taking my first steps in Turing (and Julia) trying to solve a model inversion problem in a Hidden Markov Model. The model I have so far works fine with SMC(), IS() and PG(). For HMC() and NUTS()...
View ArticleUnitful abstract types as arguments to function
I would like to write a function that takes as argument an array of a Unitful.Quantity. Ideally with a type derived from a an abstract type such as AbstractFloat, dimensions to be defined, and any...
View ArticleConditional iterator?
Is it possible to write something like this: for (key, val) in dict if val != b # do something end This would do the job for (key, val) in dict if val == b continue end # do something end and this too...
View ArticleFitting ODE system to one single data
Hi everyone, I have an ODE system with 5 equations and I want to fit it to a data. However, the data is related to only one of the equations. I am trying to use the functions in Parameters Estimation...
View Article