Questions tagged [julia]

The Julia programming language is fast, expressive and dynamic. By aggressively targeting technical computing it has become a robust general purpose language. It addresses the two-language problem by combining the ease of use of high-level languages such as R and Python with the performance of C and Fortran.

Filter by
Sorted by
Tagged with
-4 votes
0 answers
20 views

Conceptual Julia questions before writing a brand new code [closed]

I understand this is somewhat of a more conceptual question, but I think that getting useful feedback from capable people BEFORE doing something silly is better than fixing it later on. This is in a ...
TheWhitestOfFangs's user avatar
1 vote
1 answer
33 views

In julia, how to dispatch different kinds of "MutableNamedTuple"

My Julia code uses many different kinds of MutableNamedTuples e.g. box = MutableNamedTuple CSV(file::String) = box(rows=[], file=file) NUM() = box(n=0,mu=0, sd=0, m2=0) I want to dispatch methods ...
Tim Menzies's user avatar
0 votes
0 answers
8 views

How do I compute an ODE with a complex Ginzburg-Landau equation in Julia?

first time asking a question here! I am trying to program coupled nonlinear oscillators in Julia using the Vilfan-Duke model. This model uses a complex Ginzburg Landau equation of the form: z_dot = (...
Pauline's user avatar
1 vote
1 answer
30 views

how to collect simulation data every n ticks from julia agents

I have an agent-based model in Julia for which I need to collect data, I am running it like: ensemblerun!(models, agent_step!, dummystep, 1000; adata, parallel = true); It actually reports values at ...
Simone Gabbriellini's user avatar
1 vote
2 answers
37 views

Issue installing Julia packages on ubuntu docker image

I have a docker image that's primarily set up to have a GitHub Actions pipeline run on it doing a bunch of stuff in R, that I also want to be able to use to run some Julia scripts that are pretty ...
colebrookson's user avatar
0 votes
2 answers
35 views

BoundsError: attempt to access Float64 at index [false]

I'm trying to use Julia to solve an ODE with the code below: using DifferentialEquations const C = 1.1; const R = 0.9; const A = 1e-4; const B = 60/72; function flow(t) bloodflow = A*sin.(2*π*t/...
Aoife Healy's user avatar
0 votes
1 answer
29 views

How to plot a vector field using Plots.jl and function with DynamicalSystems.jl signature

I am trying to convert the python code for a tutorial on Numerical bifurcation diagrams and bistable systems to Julia; however, I am struggling to make a vector field/quiver/streamplot using Julia. ...
Jared Frazier's user avatar
0 votes
0 answers
11 views

julia simplewebsockets - ERROR: ConnectError: HTTP.IOExtras.IOError

see https://juliapackages.com/p/simplewebsockets Basic usage client using SimpleWebsockets client = WebsocketClient() ended = Condition() listen(client, :connect) do ws listen(ws, :message) do ...
Bennygtp's user avatar
0 votes
0 answers
39 views

ERROR: Unexpected character with savefig in Julia

I'm just trying to save a plot with savefig but I've encountered a strange ERROR. julia> PlotlyJS.savefig(p) ERROR: Unexpected character Line: 0 Around: ...�Desea terminar el tra... ^ ...
Franco Riottini's user avatar
1 vote
1 answer
30 views

Chunked arrays in julia

I found the ChunkedArrays package in Julia as a good idea when dealing with large arrays that can be split into parts especially when multiple threads are used. I tried to install it in Julia 1.8.5 ...
armando's user avatar
  • 1,370
0 votes
0 answers
14 views

error in Pkg.add("Plots") connection reset by peer

I'm installing Julia for the first time on Ubuntu WSL2 and I'm getting the following error: ERROR: Unable to automatically download/install artifact 'JpegTurbo' from sources listed in '/mnt/d/username/...
NNN's user avatar
  • 695
0 votes
1 answer
44 views

Julia Differential Equations: Kuramoto model as DDE: Results don't converge when constant_lags are specified

Copy-pasting from the issue I opened on github (https://github.com/SciML/DifferentialEquations.jl/issues/983). Hello, Here is my problem: I am trying to simulate the Kuramoto model with time delays ...
duodenum's user avatar
0 votes
2 answers
54 views

How to see all functions in a Module

julia> using LinearAlgebra; a = [b; for b in names(LinearAlgebra)] 131-element Vector{Symbol}: :/ :Adjoint :BLAS :Bidiagonal :...
Vinod's user avatar
  • 4,176
3 votes
2 answers
54 views

Overloading methods for parametrized struct

Short Version I have a struct like @kwdef mutable struct Params{B, C} a::Float64 = 42 end where B and C are symbols that will determine which function to use out of many functions that are ...
Jared Frazier's user avatar
0 votes
1 answer
35 views

Julia MethodError: no method matching

I am running the folowing code: function P_diastole(P0,t,R,C) t0 = t[1]; P_diastole = P0*exp((-(t.-t0))./(R*C)) return P_diastole end t = 0:0.1:5; P0 = 80; R = 700; C = 2.56; P = ...
Aoife Healy's user avatar
2 votes
1 answer
37 views

How do I color a julia DataFrame column for output in Jupyter notebook?

How do I apply a function that highlights cells of a particular df column a given color on a julia DataFrame for output into a Jupyter notebook? using DataFrames using Crayons crayon_red_light = ...
BAR's user avatar
  • 16k
0 votes
0 answers
24 views

Revise.jl not reloading project in jupyter

I am using the following cell code in jupyter notebook: using Revise includet("../../src/MyProject.jl") using .MyProject However, if I make edits to the project source and rerun the cell ...
BAR's user avatar
  • 16k
1 vote
1 answer
19 views

Trouble transforming column in Julia DataFrame based on condition on rows

I am wondering what I am doing wrong with this conditional transform in Julia's DataFrames. I tried going with the examples here but somehow could not translate the instructions to write a function ...
KeynesCoeFen's user avatar
0 votes
0 answers
38 views

ERROR: could not load library "libGR.dll"

I am a complete beginner to Julia and have some experience with Python. I want to do plotting in Julia but got this Error message, ERROR: could not load library "libGR.dll" I have a simple ...
Jed Christer's user avatar
0 votes
1 answer
60 views

After the assignment "b = a", when does changing "a" in Julia also changes "b" and when it does not?

Suppose I have run the assignment b = a in Julia. Then I change a. In what cases does b change automatically and when not? Notes The answer to Creating copies in Julia with = operator covers the same ...
Rodolfo's user avatar
  • 191
0 votes
2 answers
72 views

Error when attempting to solve Ordinary Differential equation using Symplectic solver in Julia

using LinearAlgebra using PyPlot using Random using DifferentialEquations N = 100 σ, a, J, K = 10.0, 1.0, 1.0,-0.1; ω = zeros(N); function heaviside(x::Real) return x >= 0.0 ? 1.0 : 0.0 ...
MSA's user avatar
  • 67
1 vote
1 answer
31 views

Efficient way to calculate change for multiple columns in Julia

Say I have a DataFrame in Julia: using DataFrames, Dates # Sample data df = DataFrame( id = [1, 1, 2, 2, 3, 3], filing_date = Date.(["2022-01-01", "2022-02-01", "2022-...
IsThere's user avatar
  • 13
-1 votes
1 answer
23 views

Error using Latexify.jl: type LotkaVolterra has no field funcs

I'm trying to follow along with this tutorial https://www.youtube.com/watch?v=KPEqYtEd-zY and I encounter the error "type LotkaVolterra has no field funcs" when I run the latexalign function....
Spaceman98's user avatar
0 votes
1 answer
21 views

Pushing to array in Julia: failure to create inner arrays of varying dimension

I have a loop like so: edge_weights = Int[]; edge_weights_array = [edge_weights for _ in 1:199]; #make a little function for figuring out column indices function get_columnindices(graph_base_table)::...
KeynesCoeFen's user avatar
0 votes
2 answers
44 views

how to create many subsets of existing paths?

In OpenStreetMapX we can create random path via: using OpenStreetMapX map_file_path = joinpath(dirname(pathof(OpenStreetMapX)),"..","test/data/reno_east3.osm") mx = get_map_data(...
Rainbow's user avatar
  • 181
0 votes
2 answers
56 views

How to use multithreading in a looped function in julia

I have a big dataset and a function. The function looks like this: function myfunc(df) iter = size(df)[1] v1 = Vector{Int64}() v2 = Vector{Int64}() v3 = Vector{Int64}() v4 = Vector{...
Chao's user avatar
  • 49
1 vote
1 answer
35 views

How do I efficiently access functions by index in Julia?

I havea set of functions that I want to use on some data. Currently, I am storing these functions in a global array to be able to index them. const global _rot01(x)::Tuple{Int64, Int64, Int64} = ( x[1]...
TheOneAndOnlyMrX's user avatar
0 votes
0 answers
17 views

julia - Why will Threads.@spawn and Threads.@threads execute for different time?

I saw a post from here I do not know why withthreads() needs more time than withsync(). function withthreads() arr = zeros(Int, 10) Threads.@threads for i in 1:10 # sleep(3 * rand()) ...
Yi Wangtian's user avatar
0 votes
1 answer
40 views

Julia DataFrames - Create single transformation requiring column name and local variables

I need to normalize my data columns so that the top data maps to approximately 1.0 and the bottom data maps to approximately -1.0. The data has been tagged with section column with top, falling, ...
Mark Norris's user avatar
2 votes
1 answer
35 views

Julia subset function not skipping missing values?

I have this code snippet which works fine when my filtering function checks for missing values and throws them out, too: function subset_simple(code)::Bool if ismissing(code) return false end ...
KeynesCoeFen's user avatar
2 votes
0 answers
34 views

Command hangs: `run(pipeline(`git --no-pager diff`, stderr=err, stdout=out), wait=true)`

Note: this question was asked previously at discourse.julialang.org but wasn't resolved. The issue occurred while debugging DrWatson.jl (#300) This works fine in a git repository (with changed files): ...
Adomas Baliuka's user avatar
2 votes
1 answer
43 views

GitHub Action test julia submodules

I have a project with the following structure: my_project - .github\workflows - my_github_action.yml - src - main.jl - Manifest.toml - Project.toml -my_sub_module1 - ...
CoJump's user avatar
  • 33
1 vote
1 answer
41 views

Julia optimization with values only for one variable?

so I'm working on optimization with Julia and so far I could solve a Vector-ODE System with my following code. (Anything under bracket "ODE Model" is not relevant since its just my physical ...
laurendie08's user avatar
0 votes
1 answer
32 views

How to change bar plot orientation in Plots.jl

When I try this: using Plots bar(["a", "b", "c"], [5, 9, 7]; legend=false, orientation=:h) I get this (not desired result as you can see): How to properly change the ...
SevenSouls's user avatar
4 votes
1 answer
38 views

Julia: Extract unicode key from a character

In Julian, I want to know the specific unicide-key of a character and save it to a variable. How to I do that? I can for instance write Unicode characters in the REPL and it will gladly tell me their ...
Mikael Fremling's user avatar
0 votes
1 answer
66 views

How to store an array of matrices in a CUDA array in Julia

Let's say I have an array A which stores a 2 by 2 matrix A[x] at each index/location x. In my code, I want to do basic operations such as pointwise multiplication and addition but also do a circular ...
thehardyreader's user avatar
1 vote
1 answer
27 views

Calculate percentage change by year and sector in Julia

I have dataframe as follow: julia> println(df_roa_kvkt) 15×3 DataFrame Row │ year sector roa │ Int64 String Float64 ─────┼────────────────────────────...
Tann's user avatar
  • 23
0 votes
1 answer
70 views

Julia function unwittingly modifies its argument without ! - help me understand this behaviour?

I do not understand this behaviour of Julia. Somehow, the arrays xit and mut are connected at the hip and share values in the following MWE below: sample_size = 100; mc_reps = 100; ka = .01; threshold=...
KeynesCoeFen's user avatar
0 votes
1 answer
53 views

Julia Differentiation

I have been looking on many different pages for a suitable Julia package to compute a similar (but more complicated) differentiation to the one below. Say we have a function f(x)=5x[1]^4 - 2x[2]^2 is ...
L_J's user avatar
  • 1
1 vote
1 answer
26 views

Can't run Julia script using environment libraries

Heyo. I've been struggling running packages and might need some help. Here's what I've done so far: Used Pkg to generate a project called Void Added CSV and DataFrames as dependencies (which got ...
Ranieri's user avatar
  • 25
1 vote
2 answers
58 views

Condition on arguments of a function in Julia

It is possible to specify the argument type for a function in Julia like : addition(x::Int64,y::Int64). I can, simultaneously, define another function with the same name : addition(x::Float64,y::Int64)...
Nitin's user avatar
  • 135
0 votes
2 answers
47 views

Array comprehension of array-valued function in Julia - inner dimensions somehow removed?

I am confused about the following behaviour of Julia when using array comprehensions that have arrays/matrices in them. They seemingly seem to bury the other dimensions of the inside array. I am ...
KeynesCoeFen's user avatar
-1 votes
1 answer
37 views

Julia Rolling Time Windows

I have a Julia DataFrame with one column being dates and another column being sales data. At each date entry, I want the sum of the total sales in the last 360 days exactly. Haven’t tried anything ...
mpgk444's user avatar
  • 17
1 vote
2 answers
23 views

Running an async function with a limited number of threads in julia

How do you make a function run async or with Threads when you have started julia with say 16 threads, but you only want to run 4 threads at once for this method? for name in names for age in ages ...
BAR's user avatar
  • 16k
1 vote
1 answer
71 views

How to do a Yule-Walker analysis in Julia

Is there a method in Julia to perform a Yule-Walker analysis similar to the equivalent method in Python statsmodels.regression.linear_model.yule_walker ?
Jose Manuel de Frutos's user avatar
0 votes
1 answer
54 views

Convert String31 with Comma as decimal to Float Number

I have a data frame with 190 columns in the format String31? using a comma as the decimal separator. I need to replace those commas with periods and then convert them to a numeric format. How can I do ...
RxT's user avatar
  • 488
2 votes
1 answer
35 views

How to get the sequence number of the REPL prompt you are on

In Julia programming, it's convenient to write and test some new functions in the REPL. Sometimes I will get error messages point to REPL[x], x is the sequence number of the current REPL session I was ...
ObigOne's user avatar
  • 41
0 votes
1 answer
33 views

Symbolic expression simplification in Julia Symbolics

I have a piece of code here in Julia: using Symbolics @variables x y z 3-element Vector{Num}: x y z julia> q = [x y z]*[1 2 3;4 5 6;5 4 2]*[x y z]' 1×1 Matrix{Num}: x*(x + 4y + 5z) + y*(...
Vinod's user avatar
  • 4,176
1 vote
3 answers
50 views

Method to find the quantile of a sample value given value vector in julia

How do I calculate the quantile of a sample value given an array of samples in julia? The Statistics.jl package kind of goes the other way here. samples = collect(1:50) sample = 27 quantile(samples, ...
BAR's user avatar
  • 16k
0 votes
1 answer
38 views

How can I change the package directory

I am using a university server to run some julia files. The contents of the C:/ drive are deleted every evening so that includes any packages I may have downloaded. (@v1.9) pkg> st Status `C:\...
chris's user avatar
  • 1

1
2 3 4 5
247