Running Julia .jl files

I'm new to julia and just finished my first program. I wrote the code in julia-studio and have been testing it within that program. It gives me all of the correct output, but the shell separates...

Julia: Find the intersection of two vectors and their indices to help concatenate two time series

I'm trying to learn the Julia language, so I'm attempting to port some MATLAB and Octave code I have lying around to help me learn. Specifically in this instance, the reason I'm looking for a way...

julia find in matrix with (row,col) instead of index

In Julia you can find the coordinates of elements in a matrix via: julia> find( x -> x == 2, [ 1 2 3; 2 3 4; 1 0 2] ) 3-element Array{Int64,1}: 2 4 9 These values are correct but I would...

Julia parallel computing in IPython Jupyter

I'm preparing a small presentation in Ipython where I want to show how easy it is to do parallel operation in Julia. It's basically a Monte Carlo Pi calculation described here The problem is that...

Julia - Access two elements in a for loop

What is a quick way to get two neighboured elements when looping through a for loop in julia? Suppose I have z = linspace(1, 10, 9) for i in z[1:length(z)-1] println(i, " ") end Can I...

Subscript multiple characters in Julia variable name?

I can write: x\_m<TAB> = 5 to get x subscript m as a variable name in Julia. What if I want to subscript a word instead of a single character? This x\_max<TAB> = 5 doesn't work....

Convert Dict to Array{Tuple} in Julia

In Julia programming language, what is the best way to get an Array of Tuples from a Dict? I want the first element to be the key and the second element to be the value. I have the following, but...

How Julia use Lufact to solve Ax=b

I want to recreate a solve function(solve Ax = b for x) for sparse matrix. In the Julia documentation, it says that when we applied a sparse matrix to lufact(), it returns the following: L, U, p,...

Unexpected memory allocation when using array views (julia)

I'm trying to search for the desired pattern (variable template) in the array X. The length of the template is 9. I'm doing something like: function check_alloc{T <: ZeroOne}(x ::...

How to replace dummy values with missing in Julia Dataframes?

I have a set of weather data from ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/. The dataset includes temperatures and rainfall etc. and uses -9999 as a dummy value to represent missing data. I...

$setIntersection for new set of array to be searched return count matched

For movies released in the USA with a tomatoes.viewer.rating greater than or equal to 3, calculate a new field called num_favs that represets how many favorites appear in the cast field of the...

convert CSV file to nested JSON and insert in to mongodb using python

I have a CSV file named data.csv. I want to convert this flat CSV file in to nested JSON and insert it in to mongodb using python.Below is the code which i have used to convert CSV to nested JSON,...

Limit GPU Memory in Julia using CuArrays

I'm fairly new to julia and I'm currently trying out some deep convolution networks with recurrent structures. I'm training the networks on a GPU using CuArrays(CUDA Version 9.0). Having two...

How to overload Base.show for custom array types?

Suppose I make my own custom vector type with it's own custom show method: struct MyVector{T} <: AbstractVector{T} v::Vector{T} end function Base.show(io::IO, v::MyVector{T}) where {T} ...

Julia MethodError: no method matching (::Dense{typeof(logistic),CuArray{Float32,2,Nothing},CuArray{Float32,1,Nothing}})(::Float32)

I have the following training data in CuArrays. X: 300×8544 CuArray{Float32,2,Nothing} y: 5×8544 Flux.OneHotMatrix{CuArray{Flux.OneHotVector,1,Nothing}} and I have the following model I want...

How to pretty print matrix to String in Julia?

How to use show to pretty print matrix to String? It's possible to print it to stdout with show(stdout, "text/plain", rand(3, 3)). I'm looking for something like str = show("text/plain", rand(3, 3))

How do I access an element in a CuArray of Julia and change its value?

I want to change only one element, as shown in the code below. using Flux, CuArrays a = rand(3,3) |> gpu CuArrays.allowscalar(false) a[1, 1] = 1.0f0 Because allowscalar is set to false, it is...

Kernel Error using Julia on Jupyter Notebook

Hi so I'm quite new with using Julia and Notebook. When I first downloaded Julia, everything worked great, but then suddenly the kernel said it was dead and I couldn't get it to work again...

julia.core.JuliaError: Exception 'ArgumentError' occurred while calling julia code: using PyCall

I've been trying to run this project: https://github.com/pjssilva/Robot-dance I've already installed all the required packaged, and both Julia and Python, but still I get the following error: ...

How to convert String Series to Datetime Series in Julia

I have a csv file which looks like below, 20×2 DataFrame │ Row │ Id │ Date │ │ │ Int64 │ String ...

Running .jl file from R or Python

I am new to Julia. I developed a few lines of code to get the results I needed from packages I was not able to find in Python or R. Now, I am trying to get this file to be easily accessible, and...

How to add latest Julia version to Jupyter Notebook

I installed Julia 1.5.3 on my Linux Mint 20 system. I copied the Julia files in julia-1.5.3-linux-x86_64.tar.gz to /opt/julia-1.5.3/, adjacent to the folder /opt/julia-1.4.1/, (I did not change...

VS code run selection in interactive window doesn't work

I have VS code 1.56 where I'm trying to run both python and julia. I have some problems running selected python code in the interactive windows. When I press the keybindings (shift + enter) I...

julia not finding "standard" packages (or LOAD_PATH)?

Upgraded [from 1.5.3] to Julia 1.6.3 on Ubuntu 20.04 [Windwos 10 WSL2] info: building from julia github repo and not via apt My local clone resides on the Windows filesystem and I navigated there...

Julia - Repeat entries of a vector by another vector (inner)

I have an array x and I would like to repeat each entry of x a number of times specified by the corresponding entries of another array y, of the same length of x. x = [1, 2, 3, 4, 5] # Array to...

Make a 2-dimensional lattice in Julia

Context Let us consider 5 x 5 lattice with each point indexed as (1,1),(1,2),...(1,5),(2,1),...,(5,5), and call this lattice L. What I want to do I want to make a 5 x 5 matrix with each element...

JavaScript fractal generation algorithms - why is one so much faster?

I'm trying to write a JavaScript fractal generation algorithm from first principles. I'm aware that there are many examples out there but I wanted to incorporate additional functionality to...

Prime numbers between given two numbers in Julia and Python comparison

See the Python code for finding prime numbers between given two numbers lower and upper: lower = 3 upper = 15 print("Prime numbers between", lower, "and", upper, "are:") for num in range(lower,...

Datetimes for Julia dataframes

pandas has a number of very handy utilities for manipulating datetime indices. Is there any similar functionality in Julia? I have not found any tutorials for working with such things, though it...

Is the timing of MATLAB reliable? If yes, can we reproduce the performance with julia, fortran, etc.?

Originally this is a problem coming up in mathematica.SE, but since multiple programming languages have involved in the discussion, I think it's better to rephrase it a bit and post it here. In...