Strange re-typing of arrays of numbers
Hello, I was putting together some multiple-dispatches to find that it doesn’t work as I would expect. Or rather, maybe dispatching works perfectly great, but my arrays of numbers get re-typed...
View ArticleNested struct or something else?
In a certain program, I need to cater with a model M :=(omega, eos), where omega:=(omega_1,... omega_P) and eos:=(eos_1,..., eos_Q) are “lists” of P and Q real parameters, with P known in advance (at...
View ArticleProblem in adding of ImageView.jl
(@JuliaPro_v1.5.3-1) pkg> add ImageView Resolving package versions... Downloading artifact: GTK3 Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient...
View ArticleMacro to write function with many conditionals
The minimum working case would be: Let say I have a vector of mixed types: x = [ isodd(i) ? rand(Int64) : rand(Float64) for i in 1:1000 ] I want to sum these numbers, with: function mysum(x) s = 0....
View ArticleHow does Julia dispatch on concrete methods?
Hi all, I’m trying to understand how Julia figures out what functions to call when we implement an interface from say a library (or from some other module). That library has some functions that then...
View ArticleMultiple dispatch with Union of parametric types
Hi, I have a problem with multidispatch. I have a lot of functions defined that take 2 parameters a and b. These may be a vector and a dict, a dict and an int etc. Or e.g. Union{Any, Vector}. It all...
View ArticleIterating over row in a DataFrame
Hello, I wish I could implement one of my Python models on Julia, but have been stuck for hours on the basic iteration problem in the context of the Julia language. Basically, I just want to iterate...
View ArticleGeneral method for new structure
Hi, I have made the CyclicArray type (https://github.com/udistr/CyclicArrays.jl) which defines a new structure: struct CyclicArray{T,N} <: AbstractArray{T,N} data::AbstractArray{T,N} connections...
View ArticleRecursively generating a tuple from intermediate neural network outputs
Hi, I have different neural network “encoders” and would like to generate a tuple containing the output of intermediate stages. The encoders and the number of their stages vary. So essentially I want...
View ArticleError when installing RDatasets and DataFrames packages
I m new in Julia, when installing RDatasets and DataFrames packages I get an error from GitHub server. Is there any solution for this? Thanks (excuse my little english) 7 posts - 2 participants Read...
View ArticleQuestion regarding push! and array of arrays
Hello, I have a question about a very unexpected behavior I encountered, I’d like an ELI5. Why does this: vi = fill(Int[], 5) vi[2] = [5,6] push!(vi[3], 9) result in [9] [5, 6] [9] [9] [9] instead of...
View ArticleWhy is there a type "Pair"?
I recently learned of the existence of the => operator, which forms an element of type Pair: julia> 2 => ones(4) 2 => [1.0, 1.0, 1.0, 1.0] which makes a Pair. I just assumed Pair was a...
View ArticleMethod dispatch
Julia is a lot about multiple dispatching and I am having trouble to understand what an idiomatic way of using mulitple dispatch is. My question is for small methods if I should define two different...
View ArticleJulia equivalent to r's source
Hello, it is possible to import some functions defined in a separate file (e.g. funCollection.jl) into another file (e.g. file.jl)? Essentially I am looking for the julai version of R’s source. Thank...
View ArticleCan anyone help? when I tried to download a picture file from the web, I...
I am following the class of " Working with images in Julia | Week 1 | 18.S191 MIT Fall 2020 | Grant Sanderson" and tried to write the code in my Julia notebook as:url =...
View ArticleLoad Package Multirate
I would like to do a lowpass filter and decimate operation. It seems that the “Multrate” package has an extension to the filter method in “DSP” that would be ideal. When I try to load this package I...
View ArticleGadfly ERROR: MethodError: no method matching evalmapping(::DataFrame,...
Can somebody explain the error I get when running this: draw(SVG("/tmp/ex.svg", 30cm, 20cm), plot(layer(DataFrame(x=[1, 2, 3], y=[5, 6, 9]), x=:x, y=:y, size=1pt, Geom.point,...
View ArticleWhat are common mistakes in julia that beginners should aware of?
I’ve been reading all reference materials of Julia seen alot of scopes, … all things. Would you please paint a code of mistake that begineer (especially python developers) do when writing simple like...
View ArticlePrevent overriding an array
Hi, if I perform the following code function next_step(x, i) x[i] = x[i]+1 return x end x = [0,0,0,0] x_a = next_step(x, 1) the value of x is [1,0,0,0]. The value should be still [0,0,0,0]. Why do the...
View ArticleUnsatisfiable requirement for CUDAnative
I am getting this error when installing CUDAnative. Any idea on how to solve these dependencies? (@v1.5) pkg> add CUDAnative Updating registry at `~/.julia/registries/General`...
View Article