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

Difference between `CategoricalArray` constructor and `categorical` function

The CategoricalArray constructor and the categorical function from CategoricalArrays.jl seem to be nearly identical in behavior: julia> using CategoricalArrays julia> x = CategoricalArray(["a", "b", "c"]; ordered=true, levels=["c", "b",…
Cameron Bieganek
  • 7,208
  • 1
  • 23
  • 40
5
votes
1 answer

Getting a random float value in [-1, 1] in Julia

Is p = rand(-1.:eps():1., 100000) a good way to get random Float values in [-1, 1]? A common suggestion seems to be 2. * rand(100000) - 1. instead, but this doesn't ever return 1 since rand's range is [0, 1) this skips out on a lot of values:…
Sundar R
  • 13,776
  • 6
  • 49
  • 76
5
votes
2 answers

How to remove the WARNING: replace module in Julia

I have a couple Julia files within a directory, namely FolderName | |---main.jl |---VectorFunctions.jl |---MatrixFunctions.jl The following is the structure for the files: VectorFunctions.jl module VectorFunctions #…
Aayaan Sahu
  • 125
  • 1
  • 8
5
votes
1 answer

How to increase Julia code performance by preventing memory allocation?

I am reading Julia performance tips, https://docs.julialang.org/en/v1/manual/performance-tips/ At the beginning, it mentions two examples. Example 1, julia> x = rand(1000); julia> function sum_global() s = 0.0 for i in x s…
CRquantum
  • 546
  • 3
  • 14
5
votes
1 answer

How to filter a julia dataframe?

Datafrme as follows: julia> df3 8×6 DataFrame │ Row │ RegionID │ RegionName │ StateName │ SizeRank │ 2008-03 │ 2008-04 │ │ │ Any │ Any │ Any │ Any │ Any │ Any …
AVA
  • 2,474
  • 2
  • 26
  • 41
5
votes
0 answers

Avro.jl : Trouble appending records (UPDATE)

I am new to using Avro and Avro.jl in particular. I am having difficulty in writing a record and then appending a second record in a way that I can read it later. I am also in need of being able to read the files in python as well as Julia. I chose…
5
votes
1 answer

How to set number of minor tick marks for only one but not both the axes?

Consider the following code: using Plots gr() x = 1:10 y = rand(10) plot(x, y) xaxis!(minorticks=10) which produces the following plot: There are 10 minor tick marks on both x- and y-axis. I like to set the number of minor tick marks on only the…
cbsteh
  • 809
  • 6
  • 19
5
votes
1 answer

How to efficiently construct a large SparseArray? Packages for this?

Problem Does Julia have an efficient way of constructing a huge sparse matrix from a given list of entries (u,v,w), some of which can have the same locations (u,v), and in that case, their weights w must be summed. Thus u,v,w are input vectors and I…
5
votes
1 answer

Julia is not using all of the available CPU threads

I'm doing some calculation in Julia and noticed it's running significantly slower (about 25 times!) than numpy counterpart. Then I realized Julia is only using 8 threads out of total 96 CPU threads (48 physical cores) on my PC while numpy seems to…
Kim
  • 75
  • 3
5
votes
1 answer

How to build Julia from source?

I have a fork (or a feature branch) of the core Julia Language and I want to build the code into an actual language I can use and test out. How do I build Julia from source to test my change?
logankilpatrick
  • 13,148
  • 7
  • 44
  • 125
5
votes
1 answer

How to scatter randomly points on a sphere

using PyPlot n = 50 u = range(0,stop=2*π,length=n); v = range(0,stop=π,length=n); x = cos.(u) * sin.(v)'; y = sin.(u) * sin.(v)'; z = ones(n) * cos.(v)'; scatter3D(vec(x),vec(y),vec(z);c="red",s=1) However, if I multiply vec(x), vec(y), vec(z)…
5
votes
1 answer

Julia error while computing powers of a complex number

I'm a beginner at Julia and am using it to compute the power of a complex number as a subroutine in a larger scientific task where I run array = [1im^(i-j) for i in 1:5, j in 1:5] but I get the following DomainError : DomainError with -1: Cannot…
Ananth_Rao
  • 97
  • 5
5
votes
1 answer

Can't access Julia Array ( BoundsError: attempt to access 0-element Vector{Int64} at index [1] )

Julia Code: seed = 1234 N = 2 newNum = Int64[] for i in 1:N seq = digits(seed*seed, pad=8) seed = seq[6]*1000+seq[5]*100+seq[4]*10+seq[3] newNum[i] = seed end newNum[2] Error: https://i.stack.imgur.com/3p390.png
Bifrost
  • 73
  • 5
5
votes
1 answer

Julia. Summarise one column into a new DataFrame with multiple columns

I need to group a dataframe by one variable and then summarising it by adding the number or rows (I can already do this) and number of columns relative to .25, .5, .75 quantiles of another variable. In R I would do e.g.: iris %>% …
Bakaburg
  • 3,165
  • 4
  • 32
  • 64
5
votes
1 answer

How to use the package AWSS3.jl to connect to an S3 bucket running on an EC2 instance?

I am trying to use Julia on an AWS computing cluster, processing data from Amazon S3 buckets. How do I use in Julia AWSS3.jl to open a connection to an S3 bucket? In particular I would like to know what is the best approach to configure the…
user2405703
  • 87
  • 1
  • 6