# General Usage

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

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

**Page:** 671

---

## [Select dataframe row by condition of type UnitRange](https://discourse.julialang.org/t/select-dataframe-row-by-condition-of-type-unitrange/51259)

<div class="topic-metadata">

**Author:** [@Bjorn\_De](https://discourse.julialang.org/u/Bjorn_De)\
**Replies:** 2\
**Last updated:** [December 4, 2020, 4:37pm UTC](https://discourse.julialang.org/t/select-dataframe-row-by-condition-of-type-unitrange/51259 "2020-12-04T16:37:10Z")

</div>

Hi! I have a DataFrame and want to select a row by applying e.g. @where from DataFramesMeta package: 5×5 DataFrame Row │ RowRange ColRange SDV fracNA thresh │ UnitRange UnitRange Float32 Floa…

---

## [Environment not working properly in julia](https://discourse.julialang.org/t/environment-not-working-properly-in-julia/51201)

<div class="topic-metadata">

**Author:** [@Ravinder\_Ram](https://discourse.julialang.org/u/Ravinder_Ram)\
**Replies:** 6\
**Last updated:** [December 4, 2020, 3:40pm UTC](https://discourse.julialang.org/t/environment-not-working-properly-in-julia/51201 "2020-12-04T15:40:46Z")

</div>

I made seprate environment then I add Plots library but when i activate in jupyter notebook it not working

---

## [Load functions from files dynamically without including them in global scope](https://discourse.julialang.org/t/load-functions-from-files-dynamically-without-including-them-in-global-scope/51248)

<div class="topic-metadata">

**Author:** [@akhil\_teja](https://discourse.julialang.org/u/akhil_teja)\
**Replies:** 1\
**Last updated:** [December 4, 2020, 12:47pm UTC](https://discourse.julialang.org/t/load-functions-from-files-dynamically-without-including-them-in-global-scope/51248 "2020-12-04T12:47:23Z")

</div>

I want to dynamically include functions from files based on condition. Below code gives you an Idea. File1.jl function foo() println("In File1.jl") end File2.jl function foo() println("In File2.jl") end Mai…

---

## [Creating deconvolution layers in Flux compared to PyTorch](https://discourse.julialang.org/t/creating-deconvolution-layers-in-flux-compared-to-pytorch/51186)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 3\
**Last updated:** [December 4, 2020, 11:44am UTC](https://discourse.julialang.org/t/creating-deconvolution-layers-in-flux-compared-to-pytorch/51186 "2020-12-04T11:44:13Z")

</div>

Hello, Trying to port a written model from pytorch to flux. And I encounter some differences between the two libraries as expected. And wonder how to imitate the original one. While creating deconvolution layers in Pyt…

---

## [Julia on a cluster with several linux distributions](https://discourse.julialang.org/t/julia-on-a-cluster-with-several-linux-distributions/51189)

<div class="topic-metadata">

**Author:** [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Replies:** 11\
**Last updated:** [December 4, 2020, 9:56am UTC](https://discourse.julialang.org/t/julia-on-a-cluster-with-several-linux-distributions/51189 "2020-12-04T09:56:07Z")

</div>

I have access to a linux cluster of login/compute nodes with 3 linux distributions (Ubuntu Xenial, Ubuntu Bionic, and Centos7), but all with a common /home directory. So far I have deliberately stuck to one of them as I …

---

## [Scope of expressions returned from @generated functions](https://discourse.julialang.org/t/scope-of-expressions-returned-from-generated-functions/51241)

<div class="topic-metadata">

**Author:** [@dafred](https://discourse.julialang.org/u/dafred)\
**Replies:** 0\
**Last updated:** [December 4, 2020, 9:42am UTC](https://discourse.julialang.org/t/scope-of-expressions-returned-from-generated-functions/51241 "2020-12-04T09:42:17Z")

</div>

So I want to create models that have a similar calculation graph but differ in small aspects. Each model is represented as a struct with matching dispatches for function calc. To demonstrate what I have so far, I creat…

---

## [What is the idiomatic way write model in Turing](https://discourse.julialang.org/t/what-is-the-idiomatic-way-write-model-in-turing/51175)

<div class="topic-metadata">

**Author:** [@yusri-dh](https://discourse.julialang.org/u/yusri-dh)\
**Replies:** 8\
**Last updated:** [December 4, 2020, 9:09am UTC](https://discourse.julialang.org/t/what-is-the-idiomatic-way-write-model-in-turing/51175 "2020-12-04T09:09:12Z")

</div>

What is the idiomatic way to write model in Turing. For example in Turing documentation for binary coinflip: using Turing using Distributions using Random p\_true = 0.5 n = 1000 Random.seed!(12) data = rand(Bernoulli(p\_…

---

## [GroupedDataFrame combine unique non-key values](https://discourse.julialang.org/t/groupeddataframe-combine-unique-non-key-values/51232)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 2\
**Last updated:** [December 4, 2020, 6:30am UTC](https://discourse.julialang.org/t/groupeddataframe-combine-unique-non-key-values/51232 "2020-12-04T06:30:58Z")

</div>

I have the following dataframe and I need to concatenate all unique values of :c check = DataFrame(a=\[1,2,2\],b=\["a","b","b"\],c=\[0,1,0\]) check2 = check |\> @groupby(\[:a,:b\]) |\> @combine(vcat=\>:c=\>:ccat) @test check2 == D…

---

## [Disabling LaTeX generation in Documenter Markdown](https://discourse.julialang.org/t/disabling-latex-generation-in-documenter-markdown/51167)

<div class="topic-metadata">

**Author:** [@EP-Guy](https://discourse.julialang.org/u/EP-Guy)\
**Replies:** 2\
**Last updated:** [December 4, 2020, 2:34am UTC](https://discourse.julialang.org/t/disabling-latex-generation-in-documenter-markdown/51167 "2020-12-04T02:34:31Z")

</div>

Documenter.jl is being used with the Markdown backend to process docstrings into .md files. Usually the next step would be to use MkDocs or something similar to turn them into .html files. Unfortunately, the system where…

---

## [What is faster? Modular Arithmetic functions and operations](https://discourse.julialang.org/t/what-is-faster-modular-arithmetic-functions-and-operations/51211)

<div class="topic-metadata">

**Author:** [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Replies:** 20\
**Last updated:** [December 4, 2020, 1:08am UTC](https://discourse.julialang.org/t/what-is-faster-modular-arithmetic-functions-and-operations/51211 "2020-12-04T01:08:25Z")

</div>

I need to calculate the remainder of a 50000 digits BigInt divided by a 49999 digits BigInt What’s the fastest way to do it? mod()? mod1()? x%y? rem()? Is there any package to do it? Thanks!

---

## [Dataframe to nested tuple?](https://discourse.julialang.org/t/dataframe-to-nested-tuple/51182)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 6\
**Last updated:** [December 3, 2020, 11:29pm UTC](https://discourse.julialang.org/t/dataframe-to-nested-tuple/51182 "2020-12-03T23:29:13Z")

</div>

Id like to transform this: DataFrame( GroupLetter = \['A','A','B','B'\] , GroupID = \[1,1,2,2\], Col1 = \[1,2,3,4\], Col2 = \[5,6,7,8\] ) | GroupLetter │ GroupID │ Col1 │ Col2 │ │ 'A' │ 1 │ 1 │ 5 │ │…

---

## [Package dependency to an unregistered version of a registered package](https://discourse.julialang.org/t/package-dependency-to-an-unregistered-version-of-a-registered-package/51218)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 2\
**Last updated:** [December 3, 2020, 7:06pm UTC](https://discourse.julialang.org/t/package-dependency-to-an-unregistered-version-of-a-registered-package/51218 "2020-12-03T19:06:52Z")

</div>

I have a module (package) that has as a dependency a forked version of a registered module. How I can specify this dependency and how I can point to the forked version of the registered module on Github in the Project.to…

---

## [Help understanding use of macros over functions that return expressions](https://discourse.julialang.org/t/help-understanding-use-of-macros-over-functions-that-return-expressions/51217)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 1\
**Last updated:** [December 3, 2020, 6:51pm UTC](https://discourse.julialang.org/t/help-understanding-use-of-macros-over-functions-that-return-expressions/51217 "2020-12-03T18:51:50Z")

</div>

The docs are clear about how macros execute before the enclosing code is run, but I’m still having trouble imagining where this is necessary, when we already have functions that return expressions. It’s easy to come up…

---

## [Accumulating strings dynamically](https://discourse.julialang.org/t/accumulating-strings-dynamically/51209)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 5\
**Last updated:** [December 3, 2020, 5:34pm UTC](https://discourse.julialang.org/t/accumulating-strings-dynamically/51209 "2020-12-03T17:34:34Z")

</div>

I have to dynamically accumulate strings and for each string simply accumulate characters in an array push!(word, c) and then using this nifty one-liner to convert to a string foldl(\*, word) I’m just wondering if tha…

---

## [What does mean if memory allocations are shown on struct elements?](https://discourse.julialang.org/t/what-does-mean-if-memory-allocations-are-shown-on-struct-elements/51212)

<div class="topic-metadata">

**Author:** [@JuergenD](https://discourse.julialang.org/u/JuergenD)\
**Replies:** 0\
**Last updated:** [December 3, 2020, 5:20pm UTC](https://discourse.julialang.org/t/what-does-mean-if-memory-allocations-are-shown-on-struct-elements/51212 "2020-12-03T17:20:55Z")

</div>

Hi, using julia --track-allocation=user the following extract was written into a \*.mem file. What does it mean when track-allocation reports memory allocations on a specific element of the struct? Where do I need to loo…

---

## [Extended function not being seen (Is explicity imported)](https://discourse.julialang.org/t/extended-function-not-being-seen-is-explicity-imported/51200)

<div class="topic-metadata">

**Author:** [@Annie](https://discourse.julialang.org/u/Annie)\
**Replies:** 5\
**Last updated:** [December 3, 2020, 4:30pm UTC](https://discourse.julialang.org/t/extended-function-not-being-seen-is-explicity-imported/51200 "2020-12-03T16:30:22Z")

</div>

I’ve been looking at extending functions to work with a self-defined data type. Most of them I got working no problem but I am struggling to get one of them working. I define a type mutable struct ImagTimeEvolution{N,T…

---

## [Any improvements in threaded exception handling in 1.5?](https://discourse.julialang.org/t/any-improvements-in-threaded-exception-handling-in-1-5/51206)

<div class="topic-metadata">

**Author:** [@tro3](https://discourse.julialang.org/u/tro3)\
**Replies:** 0\
**Last updated:** [December 3, 2020, 4:20pm UTC](https://discourse.julialang.org/t/any-improvements-in-threaded-exception-handling-in-1-5/51206 "2020-12-03T16:20:03Z")

</div>

Turning back towards maintenance on ThreadPools.jl, were there any improvements in the 1.5 release around exception handling during threaded operations? Historically in 1.3, those exceptions have vanished into the ether…

---

## [Saving Profile data](https://discourse.julialang.org/t/saving-profile-data/51173)

<div class="topic-metadata">

**Author:** [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Replies:** 13\
**Last updated:** [December 3, 2020, 10:17am UTC](https://discourse.julialang.org/t/saving-profile-data/51173 "2020-12-03T10:17:48Z")

</div>

Is there a way to save the profiling data gathered by the Profile module? I don’t see a user-facing API for it, although some methods come close, like fetch(). I’d like to capture the profiling statistics of a large batc…

---

## [Broadcasting over combinations of inputs](https://discourse.julialang.org/t/broadcasting-over-combinations-of-inputs/50785)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 5\
**Last updated:** [December 3, 2020, 9:06am UTC](https://discourse.julialang.org/t/broadcasting-over-combinations-of-inputs/50785 "2020-12-03T09:06:41Z")

</div>

I’m looking for a design pattern that will let me broadcast a function over two input lists, returning a 2D array of the output of the function for all possible pairs from the two lists. In other words if my input array…

---

## [Coordinate Transformation on mass density](https://discourse.julialang.org/t/coordinate-transformation-on-mass-density/51040)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 6\
**Last updated:** [June 3, 2026, 9:28am UTC](https://discourse.julialang.org/t/coordinate-transformation-on-mass-density/51040 "2026-06-03T09:28:18Z")

</div>

I have a mass density, which comes from measurement and is represented by a cartesian grid and the average density over each grid cell. I need to do some computations with this density. The final computation output of t…

---

## [Julia Micro-Benchmarks graph](https://discourse.julialang.org/t/julia-micro-benchmarks-graph/50005)

<div class="topic-metadata">

**Author:** [@markcbaumann](https://discourse.julialang.org/u/markcbaumann)\
**Replies:** 10\
**Last updated:** [December 3, 2020, 6:42am UTC](https://discourse.julialang.org/t/julia-micro-benchmarks-graph/50005 "2020-12-03T06:42:57Z")

</div>

I have a question about the graph on Julia Micro-Benchmarks What is the vertical axis of this graph? What are its units?

---

## [Odd syntax error with type parameter and array literal](https://discourse.julialang.org/t/odd-syntax-error-with-type-parameter-and-array-literal/51164)

<div class="topic-metadata">

**Author:** [@hexane](https://discourse.julialang.org/u/hexane)\
**Replies:** 1\
**Last updated:** [December 3, 2020, 3:02am UTC](https://discourse.julialang.org/t/odd-syntax-error-with-type-parameter-and-array-literal/51164 "2020-12-03T03:02:13Z")

</div>

I recently ran into a weird parsing error with Julia when defining the following function: julia\> function to\_array(val::T)::Array{T} where {T} \[val\] end ERROR: syntax: space before "\[" not allowed in "{T} \[" at REPL\[14…

---

## [Delegating efficiently iteration from one object to another](https://discourse.julialang.org/t/delegating-efficiently-iteration-from-one-object-to-another/51098)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 40\
**Last updated:** [December 2, 2020, 10:17pm UTC](https://discourse.julialang.org/t/delegating-efficiently-iteration-from-one-object-to-another/51098 "2020-12-02T22:17:26Z")

</div>

My problem occured while trying to write an efficient iterator for permutations groups: they can be efficient generated by running throught the products of some lists of permutations (some transversals). I …

---

## [Improving speed of convolutions of same sized arrays](https://discourse.julialang.org/t/improving-speed-of-convolutions-of-same-sized-arrays/51124)

<div class="topic-metadata">

**Author:** [@heltonmc](https://discourse.julialang.org/u/heltonmc)\
**Replies:** 6\
**Last updated:** [December 2, 2020, 9:44pm UTC](https://discourse.julialang.org/t/improving-speed-of-convolutions-of-same-sized-arrays/51124 "2020-12-02T21:44:18Z")

</div>

Hi everyone, I have been trying to improve the performance of a model that I am using to fit experimental data with LsqFit. Unfortunately, after calculating the theoretical solution it must be convolved with a same size…

---

## [Dereferencing an Array of Struct Pointer](https://discourse.julialang.org/t/dereferencing-an-array-of-struct-pointer/51145)

<div class="topic-metadata">

**Author:** [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Replies:** 6\
**Last updated:** [December 2, 2020, 9:24pm UTC](https://discourse.julialang.org/t/dereferencing-an-array-of-struct-pointer/51145 "2020-12-02T21:24:18Z")

</div>

I’m having trouble dereferencing a pointer to an array of structs. See the following code for an example: mutable struct Test x::Float64 end tests = \[Test(1.2), Test(3.4)\] tests\_ptr = Base.unsafe\_convert(Ptr{Test…

---

## [\[SOLVED\] Usage of CSV.read recently deprecated?](https://discourse.julialang.org/t/solved-usage-of-csv-read-recently-deprecated/51129)

<div class="topic-metadata">

**Author:** [@danilo-bc](https://discourse.julialang.org/u/danilo-bc)\
**Replies:** 8\
**Last updated:** [December 2, 2020, 5:57pm UTC](https://discourse.julialang.org/t/solved-usage-of-csv-read-recently-deprecated/51129 "2020-12-02T17:57:55Z")

</div>

In 1 week, I used the following lines: using CSV: read In\_vec = read(in\_vec\_file,header=false); In\_vec = In\_vec\[1\] #turn into usable Julia vector They would return me an Array{Float64,1} of the size of my file.…

---

## [Reinterpreting a matrix view?](https://discourse.julialang.org/t/reinterpreting-a-matrix-view/51069)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 4\
**Last updated:** [December 2, 2020, 4:55pm UTC](https://discourse.julialang.org/t/reinterpreting-a-matrix-view/51069 "2020-12-02T16:55:48Z")

</div>

Hi all. I have a use case where I make a large memory buffer for a matrix, but I will regularly want to take a slightly smaller sub-array of it. Views are great, particularly for version 1.5+, but I’m wondering what happ…

---

## [How to use higher-order functions in Julia properly?](https://discourse.julialang.org/t/how-to-use-higher-order-functions-in-julia-properly/51101)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 5\
**Last updated:** [December 2, 2020, 4:46pm UTC](https://discourse.julialang.org/t/how-to-use-higher-order-functions-in-julia-properly/51101 "2020-12-02T16:46:27Z")

</div>

As was pointed out by Steven G. Johnson, higher-order functions are great part of Julia language (topic for another big discusion) and often much more suitable to solve problems that metaprogramming tools, which are for …

---

## [Complex numbers introduction using Julia ...and a Pluto notebook](https://discourse.julialang.org/t/complex-numbers-introduction-using-julia-and-a-pluto-notebook/50693)

<div class="topic-metadata">

**Author:** [@forestacorn](https://discourse.julialang.org/u/forestacorn)\
**Replies:** 1\
**Last updated:** [December 2, 2020, 3:59pm UTC](https://discourse.julialang.org/t/complex-numbers-introduction-using-julia-and-a-pluto-notebook/50693 "2020-12-02T15:59:03Z")

</div>

This introductory video by Juan Klopper may be of interest to some: Complex numbers introduction using Julia And nicely demonstrates the use of a Pluto notebook along the way.

---

## [Rectangle using pyplot vs. gr?](https://discourse.julialang.org/t/rectangle-using-pyplot-vs-gr/51117)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 1\
**Last updated:** [December 2, 2020, 2:28pm UTC](https://discourse.julialang.org/t/rectangle-using-pyplot-vs-gr/51117 "2020-12-02T14:28:29Z")

</div>

Using pyplot as backend, the following draws a rectangle: pyplot() plot(\[(1,1),(5,1),(5,3),(1,3),(1,1)\]) while if I change pyplot() to gr(), a partial rectangle is drawn, and then an error message is generated: GKS: Re…

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

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