Quantcast
Channel: First steps - JuliaLang

Converting CSV to Parquet in Julia

Hi. I have a simple dataframe that I want to convert to parquet. This is my attempt: begin df = CSV.read("/home/onur/julia-assignment/temp.csv", DataFrame) prq = Parquet.File(df) end But this is the...

View Article


Show the full error stacktrace in REPL and pipe it to a file?

Once an error occurs and the REPL shows the error and the stacktrace, is there a good way to record it and pipe/record it to a file just from the REPL? julia> myFunction() ERROR: Error in module....

View Article


Pkg.TOML.ParserError

Hi, I’ve been using Julia without issue for 6+ months. A few weeks ago I turned my computer in for a SSD upgrade, resulting in a fresh install of Win10 (and therefore Julia). I am now seeing...

View Article

Want to generate samples with all items being sampled the same number of times?

Is there any library that can help me generate random “batches” of data such that every item appears in the same number of batches (with the exception that some items may appear one more time than...

View Article

Is "import" required for user-defined modules?

When using modules, is “import” or “using” needed? The reason I ask is that in the following toy example, according to my reading of the documentation, an “import” (or “using”) statement is required....

View Article


Union{Some{T}, Nothing} behaviour

I cannot figure out how to obtain a non-nothing output from the following code. julia> struct B a::Union{Some{T}, Nothing} where {T<:Integer} end julia> b = B(nothing) B(nothing) julia> b...

View Article

Image may be NSFW.
Clik here to view.

How 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 Article

How 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 Article


Image may be NSFW.
Clik here to view.

VS 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 Article


Twinx 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 Article

How 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 Article

Can 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 Article

How 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 Article


Non-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 Article

Struct 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 Article


Performance 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 Article

Displaying 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 Article


Mutable 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 Article

Update 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 Article

Finding 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 Article

Image may be NSFW.
Clik here to view.

Signing 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 Article


Plot 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 Article


What 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 Article

Make 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 Article

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 Article