julia Questions

6

Solved

2018 Update: Be sure to check all the responses, as the answer to this question has changed multiple times over the years. At the time of this update, the Revise.jl answer is probably the best solu...
Moncada asked 30/7, 2014 at 4:39

5

Solved

I want to find the key corresponding to the min or max value of a dictionary in julia. In Python I would to the following: my_dict = {1:20, 2:10} min(my_dict, my_dict.get) Which would return the...
Vedi asked 13/10, 2015 at 20:21

3

Solved

If I do the following: A = [ 2 1 3 0 0; 1 1 2 0 0; 0 6 0 2 1; 6 0 0 1 1; 0 0 -20 3 2 ] b = [10; 8; 0; 0; 0] println(A\b) The output is: [8.000000000000002, 12.0, -6.000000000000001, -23.99999...
Berthold asked 1/2, 2023 at 7:43

5

Solved

When I type in $ julia myprog.jl foo bar baz Where in my code can I go to access the strings "foo", "bar", "baz" ? I'm looking for the Python equivalent of sys.argv
Brattishing asked 11/1, 2014 at 0:35

2

Solved

I want to be able to import or using a package that I'm writing in a directory ~/projects/ExamplePkg from my main Julia REPL / from another project or environment.
Oviduct asked 3/1, 2020 at 0:17

3

Solved

How can I increase the space between subplots in Plots.jl? Minimal non-working example: julia> using Plots; pyplot() Plots.PyPlotBackend() julia> data = [rand(100), rand(100)]; histogram...
Guntar asked 8/3, 2018 at 8:43

3

Solved

Julia has a built-in function to round to n significant digits. signif(0.0229, 2) will round to two significant digits and give 0.023. How can I chop or truncate to n significant digits so that I ...
Parts asked 18/9, 2017 at 22:35

3

Solved

Suppose in the Julia console I do using Gadfly And then realise I actually want to use a different plot command using Winston It seems that plot() will still use the Gadfly version. Is there ...
Mauretta asked 27/3, 2016 at 15:49

1

Solved

Here is a minimal working code from Julia Discourse: using LightGraphs using GraphPlot using Colors g = graphfamous("karate") membership = [1,1,1,1,1,1,1,1,2,1,1,1,1,1,2,2,1,1,2,1,2,1,2...
Aromatize asked 9/12, 2022 at 11:0

2

I have a software that is mostly written in Python and, for now, I'm using PyInstaller to bundle and distribute the software in a user-friendly way (it's part of my CI pipeline, for Linux and Windo...
Durware asked 6/6, 2021 at 18:4

3

Solved

I have a script main.jl which prints a simple "Hello world" string: println("Hello world!") However, when trying to run the script through the terminal like this: julia> main...
Righthander asked 17/2, 2022 at 14:48

2

Solved

I have a DataFrame in Julia and I want to create a new column that represents the difference between consecutive rows in a specific column. In python pandas, I would simply use df.series.diff(). Is...
Uzia asked 9/6, 2021 at 12:59

4

Solved

I have a function collect extra keyword arguments using ..., so it is like function f(args=0; kwargs...). I want to check if a keyword argument, let' say, a, exists in kwargs. What I do probably ...
Jennettejenni asked 2/2, 2016 at 15:15

3

Solved

m = [] initializes an empty array of dimension 1. I want to initialize an empty array of dimension 2 (to which I'll append values later on). Is this possible?
Alida asked 1/2, 2016 at 8:50

2

In Julia I understand I can do 2 != 3 to get false, and can also type latex, e.g. \alpha <tab> gives α. However, I want to type the symbol ≠, and in latex that would be \neq. However, in Juli...
Ovolo asked 30/12, 2022 at 12:36

3

Solved

In python you can do something like this to let you use a shortened module name: >>> import tensorflow as tf From then on you can refer to tf, instead of having to type tensorflow every...
Stormproof asked 8/2, 2017 at 3:26

1

Solved

I already know How to import Julia packages into Python. However, now I have created my own simple Julia package with the following command: using Pkg;Pkg.generate("MyPack");Pkg.activate(...
Polis asked 27/12, 2022 at 15:3

3

Solved

Consider a situation where I first create a Vector with eltype of Any incrementally; after that, I want to narrow the element type of it. How can I do that? julia> vec = Any[1, 2, 3.] 3-element ...
Appressed asked 25/12, 2022 at 9:13

2

x = r"abc" y = r"def" z = join([x,y], "|") z # => r"r\"abc\"|r\"def\"" Is there a way to join (and in general manipulate) Regex that deals only with the regex content (i.e. does not treat the...
Natividad asked 9/12, 2013 at 19:17

1

Solved

I noticed that taking views of non-"fast linear indexed" subarray allocates, while this is possible on classical vectors. Any idea, how to make this allocation free? Here is an illustrati...
Polaris asked 20/12, 2022 at 15:14

5

Solved

If you have a function, is there an easy or built-in way to apply it n times, or until the result is something specific. So, for example, if you want to apply the sqrt function 4 times, with the ef...
Matthieu asked 6/10, 2016 at 12:13

7

Solved

In julia we can check if an array contains a value, like so: > 6 in [4,6,5] true However this returns false, when attempting to check for a sub-array in a specific order: > [4,6] in [4,6,...
Breeks asked 1/4, 2016 at 0:20

3

Solved

I have the following dataframes: df1 = DataFrame( col_A = [1, 2, 3, 4, 5, 6, 7], col_B = ["A", "B", "C", "D", "E", "F", "G"],...
Dulci asked 18/12, 2022 at 2:37

1

Solved

I just started to learn Julia in Quarto but when I run the following code in a Julia chunk in Quarto: --- title: "Julia in Quarto" editor: visual format: html --- ```{julia} # generating...
Belshin asked 18/12, 2022 at 9:57

3

I know that questions about multi-threading performance in Julia have already been asked (e.g. here), but they involve fairly complex code in which many things could be at play. Here, I am running ...
Inveterate asked 24/2, 2021 at 2:13

© 2022 - 2024 — McMap. All rights reserved.