# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=837

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 838

---

## [ODE parameter estimation on a subset of the parameters](https://discourse.julialang.org/t/ode-parameter-estimation-on-a-subset-of-the-parameters/28013)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 2\
**Last updated:** [August 26, 2019, 10:45pm UTC](https://discourse.julialang.org/t/ode-parameter-estimation-on-a-subset-of-the-parameters/28013 "2019-08-26T22:45:43Z")

</div>

Hello, I’m a differential equation newbie. I have an ODE model with 50 parameters and 10 compartments. I have data measured in only 3 compartments and I wish to fit 6 parameters. The 3 compartment problem is discussed h…

---

## [Usage of QR Factors](https://discourse.julialang.org/t/usage-of-qr-factors/27877)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 12\
**Last updated:** [August 26, 2019, 5:40pm UTC](https://discourse.julialang.org/t/usage-of-qr-factors/27877 "2019-08-26T17:40:39Z")

</div>

I’d like to compute QR factorisation Q, R = qr(A) followed by the operation Matrix(Q)' \* Y. As far as I can tell, Matrix(Q) allocates another matrix the same size as A which I’d like to avoid. Is there a way to perform …

---

## [solving DiffEq on Complex Arrays](https://discourse.julialang.org/t/solving-diffeq-on-complex-arrays/24600)

<div class="topic-metadata">

**Author:** [@balintradics](https://discourse.julialang.org/u/balintradics)\
**Replies:** 10\
**Last updated:** [August 26, 2019, 4:06pm UTC](https://discourse.julialang.org/t/solving-diffeq-on-complex-arrays/24600 "2019-08-26T16:06:58Z")

</div>

Dear Julia, Following some examples, I am trying to solve a system ODE diff. eqs. on complex numbers, for which I have to use Complex array types. I have tried this from an example but it fails for me with Julia 1.0.3. …

---

## [How to install Juliapro in Arch (based OS)](https://discourse.julialang.org/t/how-to-install-juliapro-in-arch-based-os/27710)

<div class="topic-metadata">

**Author:** [@cagri](https://discourse.julialang.org/u/cagri)\
**Replies:** 7\
**Last updated:** [August 26, 2019, 1:58pm UTC](https://discourse.julialang.org/t/how-to-install-juliapro-in-arch-based-os/27710 "2019-08-26T13:58:58Z")

</div>

Hi guys, Long time python machine learning (applied to finance) researcher here :slight\_smile: After being fascinated by speed of julia, I just wanted to deep dive into julia with Knet. However, I got a little confusion…

---

## [How to draw a folium.folium.Map object using pycall and Julia?](https://discourse.julialang.org/t/how-to-draw-a-folium-folium-map-object-using-pycall-and-julia/27965)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 6\
**Last updated:** [August 26, 2019, 1:45pm UTC](https://discourse.julialang.org/t/how-to-draw-a-folium-folium-map-object-using-pycall-and-julia/27965 "2019-08-26T13:45:30Z")

</div>

I’m reading the tutorial following this link: OpenStreetMapX\_tutorial More specifically, the code I’m running is the following: using PyCall flm = pyimport("folium") matplotlib\_cm = pyimport("matplotlib.cm") matplotlib…

---

## [Handling various types of dependencies](https://discourse.julialang.org/t/handling-various-types-of-dependencies/27850)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 17\
**Last updated:** [August 26, 2019, 12:22pm UTC](https://discourse.julialang.org/t/handling-various-types-of-dependencies/27850 "2019-08-26T12:22:13Z")

</div>

(I apologize in advance for the very long post) As I use Julia for ever more complex and complete projects, I seem to run into the following problem, where a single “project” contains lots of related code, which will be…

---

## [DifferentialEquations inside CUDA kernels](https://discourse.julialang.org/t/differentialequations-inside-cuda-kernels/27800)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 3\
**Last updated:** [August 26, 2019, 7:45am UTC](https://discourse.julialang.org/t/differentialequations-inside-cuda-kernels/27800 "2019-08-26T07:45:53Z")

</div>

Hello, In my code I would like to use the integrator interface to DifferentialEquations inside CUDA kernels. Unfortunately, the type of integrators is not isbits and therefore can not be accessed inside the kernel. I wo…

---

## [Constraints for \`@generated\` function](https://discourse.julialang.org/t/constraints-for-generated-function/27967)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 2\
**Last updated:** [August 26, 2019, 6:26am UTC](https://discourse.julialang.org/t/constraints-for-generated-function/27967 "2019-08-26T06:26:01Z")

</div>

It’s really not clear to me what is and isn’t allowed in a generated function. I get this error: ERROR: generated function body is not pure. this likely means it contains a closure or comprehension. Ok, but where’s t…

---

## [Conditional indexing issue with float precision](https://discourse.julialang.org/t/conditional-indexing-issue-with-float-precision/27833)

<div class="topic-metadata">

**Author:** [@drhouse82](https://discourse.julialang.org/u/drhouse82)\
**Replies:** 14\
**Last updated:** [August 26, 2019, 5:42am UTC](https://discourse.julialang.org/t/conditional-indexing-issue-with-float-precision/27833 "2019-08-26T05:42:18Z")

</div>

Hi! I came accross a float-precision issue that I want to share and ask if there is a solution for my problem. I define an array of coordinates, an equally-sized array for the result, and I want to fill the second arra…

---

## [Help to generate code](https://discourse.julialang.org/t/help-to-generate-code/27935)

<div class="topic-metadata">

**Author:** [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Replies:** 8\
**Last updated:** [August 26, 2019, 5:09am UTC](https://discourse.julialang.org/t/help-to-generate-code/27935 "2019-08-26T05:09:19Z")

</div>

Dear community, I think I have a good use case for the learning of metaprogramming. I want to generate this code: for problem in get\_problems(analysis) for element in get\_elements(problem) …

---

## [Can you broadcast functions over arbitrary rank? (like J/APL)](https://discourse.julialang.org/t/can-you-broadcast-functions-over-arbitrary-rank-like-j-apl/27959)

<div class="topic-metadata">

**Author:** [@Inkq](https://discourse.julialang.org/u/Inkq)\
**Replies:** 5\
**Last updated:** [August 26, 2019, 12:23am UTC](https://discourse.julialang.org/t/can-you-broadcast-functions-over-arbitrary-rank-like-j-apl/27959 "2019-08-26T00:23:24Z")

</div>

Hello! I’ve been eyeing Julia for a while as a J/APL fan and really want to move some programming I would otherwise do in J into Julia, given they are both array-centric programming languages. But one of the things that…

---

## [Initializing CuArrays](https://discourse.julialang.org/t/initializing-cuarrays/27976)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 0\
**Last updated:** [August 25, 2019, 11:24pm UTC](https://discourse.julialang.org/t/initializing-cuarrays/27976 "2019-08-25T23:24:39Z")

</div>

How to initialize this type of array: ArrayName=cu(fill(\[0.0f0,0.0f0\],(20,20,5))), I don’t want to use Tuples because there are too many problems with math operations doing on them(they can’t for example increment and …

---

## [How to load and call functions defined in a standalone Python script?](https://discourse.julialang.org/t/how-to-load-and-call-functions-defined-in-a-standalone-python-script/601)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 7\
**Last updated:** [August 25, 2019, 9:23pm UTC](https://discourse.julialang.org/t/how-to-load-and-call-functions-defined-in-a-standalone-python-script/601 "2019-08-25T21:23:39Z")

</div>

Can PyCall be used to load definitions from a small Python script into Julia? For example, how can I call foo() defined in the Python script below in Julia? a = 1 b = 2 def foo(): print("Hello world!") return a …

---

## [Query.@orderby destroys DataFrame](https://discourse.julialang.org/t/query-orderby-destroys-dataframe/27114)

<div class="topic-metadata">

**Author:** [@hmmueller](https://discourse.julialang.org/u/hmmueller)\
**Replies:** 8\
**Last updated:** [August 25, 2019, 6:31pm UTC](https://discourse.julialang.org/t/query-orderby-destroys-dataframe/27114 "2019-08-25T18:31:09Z")

</div>

This code does not work: using DataFrames, Query df = DataFrame(A=\[1,2,3\], B=\[4,5,6\]); fromdata = @from i in df begin @where i.B \> 3 @select {i.A} @orderby i.A @collect DataFr…

---

## [Type Inference for CartesianIndices(array) fail when the dimension of the array is too large](https://discourse.julialang.org/t/type-inference-for-cartesianindices-array-fail-when-the-dimension-of-the-array-is-too-large/27952)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 3\
**Last updated:** [August 25, 2019, 4:06pm UTC](https://discourse.julialang.org/t/type-inference-for-cartesianindices-array-fail-when-the-dimension-of-the-array-is-too-large/27952 "2019-08-25T16:06:36Z")

</div>

I do a lot of work with high-dimensional arrays, where the dimension of my array is often 20+. I noticed that CartesianIndices fail when the dimension is too large, causing later type inferences to also fail. Here is a m…

---

## [How can I unload a module in REPL?](https://discourse.julialang.org/t/how-can-i-unload-a-module-in-repl/27962)

<div class="topic-metadata">

**Author:** [@coldinjection](https://discourse.julialang.org/u/coldinjection)\
**Replies:** 1\
**Last updated:** [August 25, 2019, 1:58pm UTC](https://discourse.julialang.org/t/how-can-i-unload-a-module-in-repl/27962 "2019-08-25T13:58:39Z")

</div>

Can I unload a module in a REPL session after using or import it? Is there a function that works like the :module - \<module name\> command in Haskell’s GHCi?

---

## [Unable to add packages in v1.2](https://discourse.julialang.org/t/unable-to-add-packages-in-v1-2/27857)

<div class="topic-metadata">

**Author:** [@Igor\_Douven](https://discourse.julialang.org/u/Igor_Douven)\
**Replies:** 14\
**Last updated:** [August 25, 2019, 11:53am UTC](https://discourse.julialang.org/t/unable-to-add-packages-in-v1-2/27857 "2019-08-25T11:53:33Z")

</div>

Hi all, I just installed v1.2 but am now unable to add packages. I’m getting the following error: ERROR: could not load library "libgit2" libcurl.so.4: ELF load command address/offset not properly aligned I’m running …

---

## [Iteration with CartesianIndices(array) is slow when the dimension of the array is large](https://discourse.julialang.org/t/iteration-with-cartesianindices-array-is-slow-when-the-dimension-of-the-array-is-large/27951)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 2\
**Last updated:** [August 25, 2019, 9:06am UTC](https://discourse.julialang.org/t/iteration-with-cartesianindices-array-is-slow-when-the-dimension-of-the-array-is-large/27951 "2019-08-25T09:06:39Z")

</div>

I’ve been playing around with CartesianIndices. It works beautifully for the most part, but I’ve noticed that it becomes slower compared to linear indexing, when the dimension of the array is large. Here is a minimal exa…

---

## [\[201908\] Compiling a Data Science Image for Julia on Windows to combat compilation latency](https://discourse.julialang.org/t/201908-compiling-a-data-science-image-for-julia-on-windows-to-combat-compilation-latency/27640)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 6\
**Last updated:** [August 24, 2019, 11:39am UTC](https://discourse.julialang.org/t/201908-compiling-a-data-science-image-for-julia-on-windows-to-combat-compilation-latency/27640 "2019-08-24T11:39:20Z")

</div>

I wanted to share some steps on how to compile a Data Science Image for Julia. 1. Remove existing installation of PackageCompiler.jl Firstly, if you have PackageCompiler.jl previously, make you remove them entirely In…

---

## [Problem with optimisation code](https://discourse.julialang.org/t/problem-with-optimisation-code/27936)

<div class="topic-metadata">

**Author:** [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)\
**Replies:** 5\
**Last updated:** [August 24, 2019, 6:26pm UTC](https://discourse.julialang.org/t/problem-with-optimisation-code/27936 "2019-08-24T18:26:29Z")

</div>

What is the issue with the following code? I upgraded the packages today and facing the error. It used to work before upgrading. using JuMP, Cbc,Ipopt,Optim m = Model(with\_optimizer(Cbc.Optimizer)) @variable(m, 0 \<= x \<…

---

## [Julia v1.3 runs this script at least 10x slower than Julia v1.1 on my computer](https://discourse.julialang.org/t/julia-v1-3-runs-this-script-at-least-10x-slower-than-julia-v1-1-on-my-computer/27815)

<div class="topic-metadata">

**Author:** [@jdjohnston](https://discourse.julialang.org/u/jdjohnston)\
**Replies:** 3\
**Last updated:** [August 24, 2019, 6:03pm UTC](https://discourse.julialang.org/t/julia-v1-3-runs-this-script-at-least-10x-slower-than-julia-v1-1-on-my-computer/27815 "2019-08-24T18:03:55Z")

</div>

Summary: This memory-hungry script runs more than 10x slower on my computer using any of the newer versions of Julia while it ran fine on Julia 1.1.1 and even early DEV version of Julia 1.3 Environment: Xubuntu 16.04.6…

---

## [Recommendations for which package to use for a complicated plot](https://discourse.julialang.org/t/recommendations-for-which-package-to-use-for-a-complicated-plot/27901)

<div class="topic-metadata">

**Author:** [@doomphoenix-qxz](https://discourse.julialang.org/u/doomphoenix-qxz)\
**Replies:** 9\
**Last updated:** [August 24, 2019, 7:47am UTC](https://discourse.julialang.org/t/recommendations-for-which-package-to-use-for-a-complicated-plot/27901 "2019-08-24T07:47:48Z")

</div>

I am trying to create a figure that looks more or less like the following (taken from J. Zhang et al., Corrosion Science 144 (2018) 44–53): Could I get recommendations for a plotting package (preferably in Julia, but…

---

## [Error Building RCall](https://discourse.julialang.org/t/error-building-rcall/27924)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 0\
**Last updated:** [August 24, 2019, 5:34am UTC](https://discourse.julialang.org/t/error-building-rcall/27924 "2019-08-24T05:34:33Z")

</div>

I noticed that I could not use the RCall package properly. When I run Pkg.build(“RCall”), I got the error message: ERROR: LoadError: R cannot be found. Set the “R\_HOME” environment variable to re-run Pkg.build(“RCall”)…

---

## [Definition of 'TTFP'](https://discourse.julialang.org/t/definition-of-ttfp/27898)

<div class="topic-metadata">

**Author:** [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Replies:** 3\
**Last updated:** [August 23, 2019, 11:59pm UTC](https://discourse.julialang.org/t/definition-of-ttfp/27898 "2019-08-23T23:59:18Z")

</div>

Citing Tamas (from the other thread) “Maybe I am overly optimistic, but in the meantime I consider it within the capacity of an average adult to wait a short while when loading unfamiliar package in a new programming lan…

---

## [Help speeding up a test progam from a book](https://discourse.julialang.org/t/help-speeding-up-a-test-progam-from-a-book/6383)

<div class="topic-metadata">

**Author:** [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)\
**Replies:** 38\
**Last updated:** [August 23, 2019, 8:14pm UTC](https://discourse.julialang.org/t/help-speeding-up-a-test-progam-from-a-book/6383 "2019-08-23T20:14:41Z")

</div>

I am reading the book, Exploring Raspberry Pi - Interfacing to the Real World with Embedded Linux by Derek Molloy. In Chapter 5, Programming on the Raspberry Pi, the author does a speed test to compare different language…

---

## [Inconsistent behavior with double indexing?](https://discourse.julialang.org/t/inconsistent-behavior-with-double-indexing/27904)

<div class="topic-metadata">

**Author:** [@cwatson](https://discourse.julialang.org/u/cwatson)\
**Replies:** 4\
**Last updated:** [August 23, 2019, 6:14pm UTC](https://discourse.julialang.org/t/inconsistent-behavior-with-double-indexing/27904 "2019-08-23T18:14:42Z")

</div>

Consider objects a and b, which are array of arrays defined below. These objects are equal according to Julia and the only difference is in how I create them. But double-indexing works very differently on each. julia\> a…

---

## [How to save a KDTree properly](https://discourse.julialang.org/t/how-to-save-a-kdtree-properly/27890)

<div class="topic-metadata">

**Author:** [@Xiucheng\_Li](https://discourse.julialang.org/u/Xiucheng_Li)\
**Replies:** 2\
**Last updated:** [August 23, 2019, 1:18pm UTC](https://discourse.julialang.org/t/how-to-save-a-kdtree-properly/27890 "2019-08-23T13:18:53Z")

</div>

I want to save a KDTree into the disk and reuse it again with JLD2, but ran into problem after loading it, using NearestNeighbors using FileIO, JLD2 kdtree = KDTree(rand(2, 100)) save("/tmp/test.jld2", "kdtree", kdtree…

---

## [The first for loop execution](https://discourse.julialang.org/t/the-first-for-loop-execution/27841)

<div class="topic-metadata">

**Author:** [@Mirsad\_Cosovic](https://discourse.julialang.org/u/Mirsad_Cosovic)\
**Replies:** 6\
**Last updated:** [August 23, 2019, 8:07am UTC](https://discourse.julialang.org/t/the-first-for-loop-execution/27841 "2019-08-23T08:07:48Z")

</div>

Hi, I wrote a simple test in Julia, I have a large sparse matrix, and I want to iterate throughout non-zero elements, but the first execution of the for loop is slow. The minimal working example is bellow. Did I do some…

---

## [Fun with kwargs methods](https://discourse.julialang.org/t/fun-with-kwargs-methods/15711)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 7\
**Last updated:** [August 23, 2019, 5:15am UTC](https://discourse.julialang.org/t/fun-with-kwargs-methods/15711 "2019-08-23T05:15:06Z")

</div>

Consider julia\> bar(x, y) = x / y bar (generic function with 1 method) julia\> bar(x, y; c) = x + y + c bar (generic function with 1 method) julia\> bar(3,4,c=5) 12 julia\> bar(3,4) ERROR: UndefKeywordError: keyword arg…

---

## [Performance of map!()](https://discourse.julialang.org/t/performance-of-map/22821)

<div class="topic-metadata">

**Author:** [@Invarianz](https://discourse.julialang.org/u/Invarianz)\
**Replies:** 12\
**Last updated:** [August 23, 2019, 4:06am UTC](https://discourse.julialang.org/t/performance-of-map/22821 "2019-08-23T04:06:02Z")

</div>

Inspired by this topic here: map vs loops vs broadcasts, I wanted to do my own tests on the speed of the functions. As it turns out the optimised for loop, map and vectorisation are all roughly in the same ballpark. Now…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=836)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=838)
