Nan Error in CSV
I have a CSV file which contains about 1500 values some of which are “nan”, I am trying to write a function that would replace the “nan” values with zero. I tried using the replace_nan(v) and CSV...
View ArticleImplementing a ceil function in a complete dataFrame
I am trying to implement the python code that looks like : forecast_out =int(math.ceil(0.1*len(df))) in julia it looks to me: forecast_out=int(ceil(0.1.*something)) tried : length(df) df[:,:] don’t...
View ArticleWhat should the first parameter be when collecting keys from a dictionary?
When using collect(), it requires two parameters, the element type and the collection. When you’re creating an array from dictionary keys what should the element type parameter be? character_inventory...
View ArticleMetaprogramming and variable scope (again)
Hi there, I’m having some troubles understanding variable scoping in macros. Here is the simplest code to show my problems macro foo(f) quote x = 2 $f end end function bar(y) @foo sum(x*i for i in...
View ArticleAvoid getting a ReshapedArray when calling reshape?
Flux has the clever array type Zeros for which arithmetic operations are implemented as basically noops (well, I guess you get the idea). The main use case is to turn of the bias term but the problem...
View ArticleAdding a complex value to an element of a real array results in InexactError
Hi, I’m just getting started with Julia and I’ve read that Julia does automatic conversion and promotion of variables, thus U = 0 U = U + 1im works properly. However, the following code U = zeros(4)...
View ArticleLoading image files not working in Pluto notebook
The following works fine in Julian mode. julia> using Images julia> readdir() 2-element Array{String,1}: "Untitled.png" "getimages.jl" julia> img = load("Untitled.png") 280×382...
View ArticleMultivariatestats: No method matching fit for PCA & DataFrame
Hi! I am currently trying to learn both ML and Julia and I am looking at this dataset, and wish to perform PCA on it. https://archive.ics.uci.edu/ml/datasets/zoo Reading the example in...
View ArticlePlot inside a loop again[, but now in Pluto]
using Plots;plotly() begin plot() for i = 0:0.1:1 vline!([i], leg = :none) sleep(0.01) end #plot!() end I want to the plot for for each iteration of the loop.How can I do it? 4 posts - 3 participants...
View ArticleWhat is Base.KeySet()?
When I use keys() the resulting data structure is a Base.KeySet(). Can someone elaborate on what that is? I searched the documentation, but I couldn’t find it. character_inventory =...
View ArticleGeneralizing functions to accept inputs with 1 or 2 (or with 2 or 3) dimensions
I wish to create a function which can accept one input and perform calculations, or can accept multiple inputs, choose the best one, and then perform calculations. I’m not sure how to approach it. I...
View ArticleInplace conversion of a (m,n)-array into an m-element array
Hi everyone, I’m new to Julia, comming from Python. I was a bit confused when defining an array as a list of lists in Python, I noticed that it isn’t an array of size(m,n). I searched the WEB and...
View ArticleFrom Int64 to Int128
Hi there, I (as a noob) have a basic question: x = typemax(Int32) x = x + 1 typeof(x) i get Int64. So we go from Int32 to Int64 y = typemax(Int64) y = y + 1 y now is -9223372036854775808 Why we cannot...
View ArticleJuMP & NLopt: Optimizer not defined
I’m trying to run the JuMP example code from the NLopt.jl page. I found someone who had a similar issue which was fixed through a restart. Unfortunately, it didn’t work in my case. Julia, JuMP, and...
View ArticleAdding rows
Hi there! I am a bit new to julia so I have a few a very basic questions: I want to sum 33 rows of an nxm matrix. How can I do so? 4 posts - 2 participants Read full topic
View ArticleHow to use dataloader
how to use dataloader like the one in pytorch in julia to load imagefolder 1 post - 1 participant Read full topic
View Article`svd` function: difference between the show instance and the output
Hello, Look at Vt here: julia> (U, SV, Vt) = svd(a) SVD{Float64,Float64,Array{Float64,2}} U factor: 2×2 Array{Float64,2}: -0.357373 -0.933962 -0.933962 0.357373 singular values: 2-element...
View ArticleAn easy way to call multiple functions from a package?
using Distributions; # Currently [Distributions.tdistpdf, Distributions.tdistlogpdf, Distributions.tdistcdf] # I want something like Distributions.[tdistpdf, tdistlogpdf, tdistcdf] wondering if there...
View ArticlePossible to define a module where one dependency is built after running other...
I need this module to create a Conda environment whose full path is required by Pkg.build() for another dependency. module BuildDepsSeparately using Pkg using Conda,Dates using RCall # install r to a...
View ArticleERROR: UndefVarError: depwarn not defined
Hi everyone! So I just recently started using Julia. I managed to install Atom and Juno following the given steps but I keep running into the same problem and so far I couldn’t figure out the...
View Article