Preprocessing function arguments
I have a working code like the following: function test(a,b) c = a + b d = a - b e = c + 2 * d end but I now want to sometimes make b a constant s.t. const b = 1.5 function test(a) c = a + b d = a - b...
View ArticleMake function accept an array of strings and return an array of strings
I’m working on a google translate package, and I’ve got the translating part, but I want a function that will do a batch translate. function batchtranslate(inputstrings::Array{String,1},...
View ArticleWhat is the most efficient binary representation of unsigned integers in Julia?
Hello everybody, I would like to know what is the most efficient binary representation in Julia? My use case is to convert an unsigned integer into a binary representation, then to mutate the elements...
View ArticlePlot group size after running groupby
I have a DataFrame with a :group column and did a gb = groupby(df, :group) I would like to plot the group sizes vs. group id. For example, for group gb[1] on the x-axis I would like to plot...
View ArticleSigning the points were 2 functions are equal
Hello, there! I’m working with some numerical calculations, plotting 2 diferent functions as follows: using Plots h=0 K=1.5 g(y) = y j(y) = tanh(K*y+h)...
View ArticleFinding unique coluns of a matrix
Dear all, I have a matrix A: A = [ 1.0 0.0 0.0 0.0 1.0 1.0 3.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.0 1.0 0.0 0.0 0.0 1.0 11.0 0.0 0.0 0.0 1.0 0.0 6.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 12.0...
View ArticleUpdate Julia Package in Jupyter notebook
Hello I have added ODE package in Julia and i tried to work in jupyter notebook env but still iam getting the error as install ODE How would i resolve it. Pls help me 2 posts - 2 participants Read...
View ArticleMutable scalar in immutable object: the best alternative?
I found this old thread about the same thing, but that was before 1.0. Actually while writing this post I figured out most of the details… now I will post it anyway. If one has an immutable struct...
View ArticleDisplaying a parquet file in Arrow
Hi. I am trying to add a Parquet file into Arrow. I tried to follow the Arrow.jl docs and implement it like this: begin df = CSV.read("/home/onur/julia-assignment/temp.csv", DataFrame) file = file =...
View ArticlePerformance disadvantages of structs?
Hello, I have a lot of large arrays (matrices of floats, vectors of floats, vectors of StaticArrays of floats, vectors of StaticArrays of ints) in my code and calling functions is becoming cumbersome,...
View ArticleStruct variables explicit setting
Hi! I know how to do this: struct a a1 a2 a3 end b=a(1,2,3) I was wondering if there’s a way to do this in a more explicit way. Something like: b=a(a1=1,a2=2,a3=3). The reason would be readability (so...
View ArticleNon-diagonal noise correlation matrix
Hi all! I am newbie to julia and I am playing with it to solve SDE systems, numerically. I had a look at Non-diagonal noise Tutorial (Example No. 4)...
View ArticleHow to 'using a_local_module'
In a project directory, I have a main.jl and a myModule.jl myModule.jl. contains module myModule … end In the main.jl, how do I use myModule ? using myModule and import myModule both are for modules...
View ArticleCan I install Plots without GR
Currently, when I Pkg.add("Plots"), GR is also installed and built. And if GR is not correctly built, which usual due to network issue, using Plots may fail because GR will also be imported. I know I...
View ArticleHow to write type-stable dataflow graphs
I’m trying to implement a dataflow graph for basic arithmetic and encountering type instability for all but trivially simple graphs. How to rewrite this in a type-stable way? module Inst # for...
View ArticleTwinx shows left yticks on right y axis
I am struggling to generate a plot with two y-axes. The left y-ticks show up on the right y-axis. Also, I am uisng rightmargin = 1.5Plots.cm, box = :on because the label margins are broken. using...
View ArticleVS Code: Julia Env different in status bar and REPL
As title already says, why does VC Code show two different activatated envs? I want to work in Oceananigans instead of in v1.5 but the REPL doesnt change. 11 posts - 2 participants Read full topic
View ArticleHow to debug "Local instance of remote reference not found"?
I tried to make a self-contained MWE but can’t replicate the error. For some reason it doesn’t like the @sync: @sync @distributed for d in 1:ndocs...
View ArticleHow to use a function to retrieve a single row of data from Parquet
Hi. I have a dataframe like this: data1336×710 41.1 KB I want to be able to get the numerical data for a single row, say, “Algeria”. This is the function that I wrote for that. function...
View ArticleHow to get local variables into SharedArray constructors?
(topic withdrawn by author, will be automatically deleted in 24 hours unless flagged) 1 post - 1 participant Read full topic
View Article