Questions tagged [julia]

The Julia programming language is fast, expressive and dynamic. By aggressively targeting technical computing it has become a robust general purpose language. It addresses the two-language problem by combining the ease of use of high-level languages such as R and Python with the performance of C and Fortran.

Julia is a high-level, high-performance dynamic programming language for technical computing. It addresses the two-language problem by combining the ease of use of languages such as R and Python with the performance of C and Fortran. Julia provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library. Environments such as Julia for VS Code, Jupyter, and Pluto provide a rich development environment with interactive graphics.

Community-contributed libraries continue to be added at a rapid pace. Programs written in Julia are organized around multiple dispatch - by defining and overloading functions with different combinations of argument types. Part of what makes Julia so expressive is that argument types can be user-defined, and user-defined types live in the same type hierarchy and have the same status as built-in types.

The Julia compiler includes a parser written in Scheme (femtolisp), some compiler passes and the runtime in C, code generation through LLVM using C++, and other compiler passes (type inference, inlining, etc.) as well as much of the Base library in Julia itself. For just-in-time generation of 64-bit or 32-bit optimized machine code the LLVM compiler framework is used.

Julia has foreign function interfaces for C, C++, Python, R, and Java, to name a few. Julia can also be embedded in any other software through its C API. Many of these interfaces are high performance and avoid copying data to the extent possible.

Resources for Julia:

Books

Publications

12250 questions
5
votes
1 answer

Find zero of a nonlinear equation using Julia

After a process usyng the SymPy in Julia, I generated a system of nonlinear equations. For the sake of simplicity, I am going to put an approximation here for the case of just a non-linear equation. What I get is something like this equation: R =…
Fam
  • 507
  • 2
  • 8
5
votes
2 answers

Parsing DateTime in a CSV file in Julia

I'm new to Julia, so just wrapping my head around the basics. I'm trying to read a CSV file into a DataFrame: abc = CSV.File("ABC.csv") The format is as follows: 2016-01-04T14:16:00Z,103.71,103.71,103.71,103.71,23300 I had expected Julia to…
cjm2671
  • 18,348
  • 31
  • 102
  • 161
5
votes
2 answers

How to set title fontsize in Plots.jl

Is there a simple way to change the fontsize of only (i.e., everything else should remain unchanged) the title in Plots.jl?
Pietro
  • 415
  • 6
  • 16
5
votes
1 answer

Using indicator constraints in Julia

JuMP provides a special syntax for creating indicator constraints.So, Which one is better, linearizing the indicator constraints and then write a code or using this feature? In order to constrain the constraint x + y <= 2 to hold when z binary…
Python.py
  • 71
  • 3
5
votes
2 answers

Julia: Parametric types with inner constructor: new and typeof

Trying to understand parametric types and the new function available for inner methods. The manual states "special function available to inner constructors which created a new object of the type". See the section of the manual on new here and the…
PatrickT
  • 10,037
  • 9
  • 76
  • 111
5
votes
3 answers

Julia: A fast and elegant way to get a matrix from an array of arrays

There is an array of arrays containing more than 10,000 pairs of Float64 values. Something like this: v = [[rand(),rand()], ..., [rand(),rand()]] I want to get a matrix with two columns from it. It is possible to bypass all pairs with a cycle, it…
Anton Degterev
  • 591
  • 2
  • 12
5
votes
3 answers

How can I slice the high-order multidimeonal array (or tensor) on the specific axis in Julia?

I am using Julia1.6 Here, X is a D-order multidimeonal array. How can I slice from i to j on the d-th axis of X ? Here is an exapmle in case of D=6 and d=4. X = rand(3,5,6,6,5,6) Y = X[:,:,:,i:j,:,:] i and j are given values which are smaller than…
Sakurai.JJ
  • 553
  • 3
  • 10
5
votes
1 answer

Processing JSON from a .txt file and converting to a DataFrame in Julia

Cross posting from Julia Discourse in case anyone here has any leads. I’m just looking for some insight into why the below code is returning a dataframe containing just the first line of my json file. If you’d like to try working with the file I’m…
clibassi
  • 67
  • 3
5
votes
1 answer

Julia's equivalent to R's ?? (double question-mark help.search across all packages)

In R you can search the documentation by typing a question mark ? or a double question mark ??. How do you search the manual for strings in the Julia REPL? >?first No documentation for ‘first’ in specified packages and libraries: you could try…
PatrickT
  • 10,037
  • 9
  • 76
  • 111
5
votes
1 answer

Is there a clean way to implement mlultiple if statements of the same type in julia?

Something like this: if mod(i,11) = 1,2,3,4,5... #do something else #do something else end I dont want to type out each condition or make a for loop, I want to keep the syntax as simple as possible.
Frosty
  • 61
  • 4
5
votes
1 answer

Labelling and specifying bins in histograms in Julia

I'm trying to plot a histogram in Julia. For illustrative purposes, in the example below I plot age, which ranges from 0 to 100. age = 100*rand(1000,1) histogram(age, xlabel = "Age", bins = range(0,100, step = 5), xticks = 0:5:100, leg =…
Dan.phi
  • 75
  • 5
5
votes
2 answers

Julia: Is it possible to pass a dictionary of parameters to a function?

I have a dictionary of function arguments that I want to pass to a function. For example: function test_function(foo::Int, bar::String) #... end params = Dict( "foo" => 1, "bar" => "baz" ) In Python, I could pass all parameters as…
A Poor
  • 856
  • 10
  • 26
5
votes
4 answers

How to unpack a Julia struct entirely into local variables?

I have created a complex computational model with lots of parameters. Since I need to run many scenarios, I have decided to wrap all those input parameters into one huge struct: using Parameters @with_kw struct MyModel a::Int = 5 b::Float64…
Przemyslaw Szufel
  • 40,002
  • 3
  • 32
  • 62
5
votes
2 answers

Convert a vector of tuples in an array in JULIA

I'm quite new to Julia and I'm trying to convert a vector of tuples in array. Here's an example using Statistics a = randn((10, 100)) q = (0.05, 0.95) conf_intervals = [quantile(a[i,:], q) for i in 1:10] and conf_intervals is a 10-element…
Luca Monno
  • 830
  • 1
  • 11
  • 25
5
votes
1 answer

Julia symbolic and numeric performance vs Python

I just translated a set of scientific calculations involving matrices which elements are symbolic expressions which are differentiated and combined with various other mathematical expressions then numerically integrated. The pieces of code below…
Tarik
  • 10,810
  • 2
  • 26
  • 40