julia Questions

2

I am starting to use Julia mainly because of its speed. Currently, I am solving a fixed point problem. Although the current version of my code runs fast I would like to know some methods to improve...
Southsoutheast asked 25/7, 2022 at 14:40

1

Solved

One can use Julia's built-in modules and functions using the juliacall package. for example: >>> from juliacall import Main as jl >>> import numpy as np # Create a 2*2 random mat...
Distrain asked 21/7, 2022 at 18:5

2

Solved

I have two (mathematical) functions: y = x y = -2x + 3 This is solved by y = 1 and x = 1. See picture: How can I make Julia do this for me?
Tko asked 3/5, 2020 at 7:45

3

Solved

I am looking for a simple way to extract the extension (.txt, .py, .jl, etc) from a file in Julia. I looked through the Julia docs but didn't see anything specifically built for this.
Ashlaring asked 11/9, 2021 at 15:45

2

Solved

What is the proper way to test if a value in a DataFrame is NA in the Julia DataFrames package? I have this far found out that typeof(var) == NAtype works, but is there a more elegant way of doing...
Defense asked 26/1, 2015 at 15:52

1

I'm trying to include a Julia function (PowerModelsDistribution.solve_mc_opf) in some Python code. The package works in Julia but I'm getting stuck on including it with PyJulia. I've tried a few th...
Yetty asked 13/7, 2022 at 14:57

1

Solved

I've just got aware of chaining functions (like a pipeline) in Julia for a couple of days. I was trying something today and got an unexpected result. Hence, I decided to ask about the root of the p...
Honna asked 13/7, 2022 at 16:16

1

Solved

In Julia, you can permanently append elements to an existing vector using append! or push!. For example: julia> vec = [1,2,3] 3-element Vector{Int64}: 1 2 3 julia> push!(vec, 4,5) 5-eleme...
Lophophore asked 8/7, 2022 at 20:37

3

Solved

I am trying to make sense of how Julia copies and treats variables. Take a look at the following examples and the following questions: a = 1 b = 1 a === b #why do they share the same address? I def...
Theone asked 8/7, 2022 at 13:43

2

Is there a way to suppress the stacktrace that accompanies an error in the Julia REPL (VS Code specific methods acceptable)? It fills my screen with a lot of output that is not useful for me to fix...
Rachael asked 2/5, 2020 at 0:41

2

Solved

I have a large simulation on a DataFrame df which I am trying to parallelize and save the results of the simulations in a DataFrame called simulation_results. The parallelization loop is working ju...
Fideliafidelio asked 5/7, 2022 at 22:32

5

Solved

Suppose I write a function in Julia that takes a Dict{K,V} as an argument, then creates arrays of type Array{K,1} and Array{V,1}. How can I extract the types K and V from the Dict object so that I ...
Quorum asked 8/1, 2014 at 9:11

2

Solved

How do I get the address of an object obj as a plain string? The pointer_from_objref() function is close to what I want, but when I print the result I get "Ptr{Void} @0x00007f3864c40038" instead of...
Noninterference asked 7/2, 2016 at 9:48

4

Solved

How do you do simply select a subset of an array based on a condition? I know Julia doesn't use vectorization, but there must be a simple way of doing the following without an ugly looking multi-li...
Jephthah asked 4/6, 2016 at 3:13

5

Solved

Is it possible to interleave two arrays in julia? For example if a=[1:10] and b=[11:20] I want to be able to return 20-element Array{Int64,1}: 1 11 2 12 3 13 4 14 . . . Somewhat si...
Gridley asked 6/6, 2014 at 13:25

2

I have a function that optionally uses threads for its main loop, doing so when an argument usingthreads is true. At the moment, the code looks like this: function dosomething(usingthreads::Bool) ...
Avidity asked 27/10, 2019 at 14:48

2

I have not been able to find a way to convert my 30,000 x 1,000 Pandas.jl String DataFrame into a DataFrames.jl DataFrame. I have attempted previous stackoverflow solutions but they have not worked...
Clarence asked 31/5, 2022 at 3:30

1

Solved

I'm unsure why the heatmap outputed by the following minimal working example using Plots plotlyjs() List_x = [1, 2, 3] List_y = [1, 2] List_f = [0 0 0; 1 2 3] my_plot = heatmap(List_x, List_y, L...
Versus asked 10/11, 2021 at 10:25

1

I am using the Symbolics.jl package and trying to invert a matrix. However, the output is giving 'true' instead of 1. Here is the code: using Symbolics @variables x mat=[x 0 0 0 x 0 0 0 x] ...
Tannate asked 27/5, 2022 at 17:22

1

Solved

I want to convert numbers into equivalent boolean. based on the official doc: "false is numerically equal to 0 and true is numerically equal to 1." So I would like to convert the numeri...
Unpracticed asked 27/5, 2022 at 13:47

8

Solved

Im looking for a function like Pythons "foobar, bar, foo".count("foo") Could not find any functions that seemed able to do this, in a obvious way. Looking for a single function or something that...
Vanward asked 3/6, 2014 at 11:49

3

I would like to know how in the Julia language, I can determine if a file.jl is run as script, such as in the call: bash$ julia file.jl It must only in this case start a function main, for examp...
Cochise asked 20/3, 2018 at 23:35

2

I want to write the julia code in the .py file, and when running the py file, the julia code can also pass normally, is this possible? I am using text editor VScode, python3.10 and julia1.7.2. Actu...
Tontine asked 21/5, 2022 at 8:51

5

Solved

I'm maintaining a Julia library that contains a function to insert a new line after every 80 characters in a long string. This function becomes extremely slow (seconds or more) when the string beco...
Leningrad asked 18/5, 2022 at 15:1

2

Solved

What is the difference between Pluto.jl and Jupyter Notebooks? How do I decide which I should prefer for teaching students? Is there a performance difference? I only found https://www.reddit.com/r/...
Dollarfish asked 13/5, 2022 at 12:22

© 2022 - 2024 — McMap. All rights reserved.