# General Usage

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

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

**Page:** 790

---

## [OutOfMemoryError() while solving a linear system](https://discourse.julialang.org/t/outofmemoryerror-while-solving-a-linear-system/33921)

<div class="topic-metadata">

**Author:** [@AhmedAlreweny](https://discourse.julialang.org/u/AhmedAlreweny)\
**Replies:** 10\
**Last updated:** [February 10, 2020, 3:59pm UTC](https://discourse.julialang.org/t/outofmemoryerror-while-solving-a-linear-system/33921 "2020-02-10T15:59:06Z")

</div>

I am trying to solve a linear system with the direct solver (backslash operator). My matrix is sparse,square and unsymmetric. The system is defined as Ax=b, where A is defined to be a SparseMatrixCSC with dimensions = 8…

---

## [Problem with parsing tag(::HTMLText) in Gumbo](https://discourse.julialang.org/t/problem-with-parsing-tag-htmltext-in-gumbo/34421)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 0\
**Last updated:** [February 10, 2020, 3:53pm UTC](https://discourse.julialang.org/t/problem-with-parsing-tag-htmltext-in-gumbo/34421 "2020-02-10T15:53:12Z")

</div>

Sombody can help ? Why HTMLText stoped it ? julia\> using HTTP,Gumbo,AbstractTrees julia\> url=url="http://bbc.com"; julia\> r=HTTP.request("GET", url; retries=4, cookies=true); julia\> doc=parsehtml(String(r.body)); j…

---

## [Unknown allocation](https://discourse.julialang.org/t/unknown-allocation/34365)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 5\
**Last updated:** [February 10, 2020, 2:53pm UTC](https://discourse.julialang.org/t/unknown-allocation/34365 "2020-02-10T14:53:17Z")

</div>

I’m trying to do lazy evaluations as follows: struct V data::Vector{Int} end f(v, x) = Base.broadcasted(+, x, v.data) g(v, x) = Base.broadcasted(\*, x, v.data) const x = \[1, 2\] const a = V(\[3, 4\]) const b = V(\[5, 6\]…

---

## [What is the fftfreq sampling frequency?](https://discourse.julialang.org/t/what-is-the-fftfreq-sampling-frequency/34406)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 1\
**Last updated:** [February 10, 2020, 1:35pm UTC](https://discourse.julialang.org/t/what-is-the-fftfreq-sampling-frequency/34406 "2020-02-10T13:35:08Z")

</div>

From my understanding, the sampling frequency is the inverse distance between data points. Is this correct, or do I have to use something else? Maybe an example can make my question a bit clearer. If I want to plot th…

---

## [Limit Julia Memory](https://discourse.julialang.org/t/limit-julia-memory/34409)

<div class="topic-metadata">

**Author:** [@altre](https://discourse.julialang.org/u/altre)\
**Replies:** 0\
**Last updated:** [February 10, 2020, 12:58pm UTC](https://discourse.julialang.org/t/limit-julia-memory/34409 "2020-02-10T12:58:16Z")

</div>

This is basically a question on the still open (but fixed) issue https://github.com/JuliaLang/julia/issues/17987 I’m trying to find the easiest way to limit the memory available for a julia process. The issue above see…

---

## [Help with compilation](https://discourse.julialang.org/t/help-with-compilation/34408)

<div class="topic-metadata">

**Author:** [@CodeLenz](https://discourse.julialang.org/u/CodeLenz)\
**Replies:** 0\
**Last updated:** [February 10, 2020, 12:23pm UTC](https://discourse.julialang.org/t/help-with-compilation/34408 "2020-02-10T12:23:36Z")

</div>

Hi. I used to compile julia in my machine, but now there is this error while compiling libunwind Blockquote checking for a BSD-compatible install… /usr/bin/install -c checking whether build environment is sane… yes …

---

## [Reuse \`Tuple\` \`convert\` mechanism in another parametric type](https://discourse.julialang.org/t/reuse-tuple-convert-mechanism-in-another-parametric-type/34353)

<div class="topic-metadata">

**Author:** [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Replies:** 4\
**Last updated:** [February 10, 2020, 7:38am UTC](https://discourse.julialang.org/t/reuse-tuple-convert-mechanism-in-another-parametric-type/34353 "2020-02-10T07:38:31Z")

</div>

Tuples have this nice behavior: z8 = (Int8(0),Int8(0)) z64 = (0,0) a8 = Vector{Tuple{Int8, Int8}}() a64 = Vector{Tuple{Int64, Int64}}() # these all work push!(a8, z8) push!(a64, z64) push!(a8, z64) push!(a64, z8) At …

---

## [What does this error message mean? From Convex.jl: Cannot \`convert\` an object of type EqConstraint](https://discourse.julialang.org/t/what-does-this-error-message-mean-from-convex-jl-cannot-convert-an-object-of-type-eqconstraint/34384)

<div class="topic-metadata">

**Author:** [@kai](https://discourse.julialang.org/u/kai)\
**Replies:** 2\
**Last updated:** [February 9, 2020, 10:50pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean-from-convex-jl-cannot-convert-an-object-of-type-eqconstraint/34384 "2020-02-09T22:50:19Z")

</div>

Hi, I ran into the following error and could not find help from reading the documentation. The error is MethodError: Cannot \`convert\` an object of type EqConstraint to an object of type Array{Constraint,N} where N My …

---

## [How can I convert this type of dictionary into a dataframe?](https://discourse.julialang.org/t/how-can-i-convert-this-type-of-dictionary-into-a-dataframe/34321)

<div class="topic-metadata">

**Author:** [@Aizzaac](https://discourse.julialang.org/u/Aizzaac)\
**Replies:** 12\
**Last updated:** [February 9, 2020, 7:13pm UTC](https://discourse.julialang.org/t/how-can-i-convert-this-type-of-dictionary-into-a-dataframe/34321 "2020-02-09T19:13:08Z")

</div>

Hi I have used a Python SDK to extract data from Splunk. In the image you can see an example of the output. I want to send that information to a DataFrame. Any clues will be helpful. Thank yoi

---

## [What is the correct way to iterate over "Kroneker Product" like terms?](https://discourse.julialang.org/t/what-is-the-correct-way-to-iterate-over-kroneker-product-like-terms/34363)

<div class="topic-metadata">

**Author:** [@ArjunNarayanan](https://discourse.julialang.org/u/ArjunNarayanan)\
**Replies:** 2\
**Last updated:** [February 9, 2020, 5:48pm UTC](https://discourse.julialang.org/t/what-is-the-correct-way-to-iterate-over-kroneker-product-like-terms/34363 "2020-02-09T17:48:29Z")

</div>

I would like to write functions that iterate over objects that have a “Kroneker Product” like structure. Consider for example: using StaticArrays struct MyKronekerType{D,N,T} data::SVector{T,N} function MyKron…

---

## [Function to create concretetype for abstracttype](https://discourse.julialang.org/t/function-to-create-concretetype-for-abstracttype/34354)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 6\
**Last updated:** [February 9, 2020, 2:46pm UTC](https://discourse.julialang.org/t/function-to-create-concretetype-for-abstracttype/34354 "2020-02-09T14:46:13Z")

</div>

Advanced Question. Background: For every abstract type in julia I can construct a respective concretetype like struct MyConcreteType{A, B, C} \<: MyAbstractType{A, B, C} end This correspondence is always possible, i.e.…

---

## [Save kwargs in struct field to be used later in function calls](https://discourse.julialang.org/t/save-kwargs-in-struct-field-to-be-used-later-in-function-calls/34376)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [February 9, 2020, 1:48pm UTC](https://discourse.julialang.org/t/save-kwargs-in-struct-field-to-be-used-later-in-function-calls/34376 "2020-02-09T13:48:07Z")

</div>

I have a struct Foo with a field that contains keyword arguments given at construction. I want to then be able to call a function with keyword arguments recovered from Foo: struct Foo kwargs end Foo(;kwargs...) = F…

---

## [DataFrames.jl: keep group by result in every row](https://discourse.julialang.org/t/dataframes-jl-keep-group-by-result-in-every-row/34110)

<div class="topic-metadata">

**Author:** [@altre](https://discourse.julialang.org/u/altre)\
**Replies:** 4\
**Last updated:** [February 9, 2020, 12:24pm UTC](https://discourse.julialang.org/t/dataframes-jl-keep-group-by-result-in-every-row/34110 "2020-02-09T12:24:05Z")

</div>

Using R data.table I’m used to saving the result of a group by aggregation in each row of each group, e.g.: \> d = data.table(a=c(1,2,3,4), b=c(1,1,2,2)) \> d a b 1: 1 1 2: 2 1 3: 3 2 4: 4 2 \> d\[,s:=sum(a), b\] \> d a…

---

## [How to convert namedarray to dataframe while preserving index/column names](https://discourse.julialang.org/t/how-to-convert-namedarray-to-dataframe-while-preserving-index-column-names/34357)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 1\
**Last updated:** [February 8, 2020, 10:45pm UTC](https://discourse.julialang.org/t/how-to-convert-namedarray-to-dataframe-while-preserving-index-column-names/34357 "2020-02-08T22:45:41Z")

</div>

Hi, I’m trying to make a pivot table in Julia that aggregates the count of something. Freqtable is perfect, except that it returns this namedarray format, and when I use to convert back to a dataframe, the index and colu…

---

## [How would I write this Pandas column filter code in Julia?](https://discourse.julialang.org/t/how-would-i-write-this-pandas-column-filter-code-in-julia/34310)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 5\
**Last updated:** [February 8, 2020, 1:54am UTC](https://discourse.julialang.org/t/how-would-i-write-this-pandas-column-filter-code-in-julia/34310 "2020-02-08T01:54:03Z")

</div>

Hi how’s t going? I’ve searched all over the place for regular expression column filtering in Julia, but I can’t seem to figure it out. Say you have a variable regex that contains a regular expression string. This wor…

---

## [Subtyping with Parametric Abstract Types](https://discourse.julialang.org/t/subtyping-with-parametric-abstract-types/34314)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 4\
**Last updated:** [February 8, 2020, 12:08am UTC](https://discourse.julialang.org/t/subtyping-with-parametric-abstract-types/34314 "2020-02-08T00:08:54Z")

</div>

I don’t understand why struct MultiDist{D \<: UnivariateDistribution{S \<: ValueSupport}} \<: MultivariateDistribution{S \<: ValueSupport} dist::D n::Int end returns that S in undefined. I also tried struct MultiD…

---

## [Pre-allocating outputs, inplace functions and performance](https://discourse.julialang.org/t/pre-allocating-outputs-inplace-functions-and-performance/34271)

<div class="topic-metadata">

**Author:** [@cosmia](https://discourse.julialang.org/u/cosmia)\
**Replies:** 13\
**Last updated:** [February 7, 2020, 10:50pm UTC](https://discourse.julialang.org/t/pre-allocating-outputs-inplace-functions-and-performance/34271 "2020-02-07T22:50:51Z")

</div>

Hi all, I’m trying to understand the Pre-allocating outputs section in the performance tips of the docs. I have a code that basically does the following: function test(x, a) if a == 1 res = x .^ 2 else …

---

## [How would you implement or replace Python-like class attributes?](https://discourse.julialang.org/t/how-would-you-implement-or-replace-python-like-class-attributes/34324)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 1\
**Last updated:** [February 7, 2020, 9:49pm UTC](https://discourse.julialang.org/t/how-would-you-implement-or-replace-python-like-class-attributes/34324 "2020-02-07T21:49:50Z")

</div>

I don’t expect this to be useful in practice, but what would be the more elegant way to associate mutable values with a type, analogous to class attributes in Python? I thought of this question after reading an example m…

---

## [How to properly store a compile-time integer constant with a struct?](https://discourse.julialang.org/t/how-to-properly-store-a-compile-time-integer-constant-with-a-struct/34293)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 9\
**Last updated:** [February 7, 2020, 6:19pm UTC](https://discourse.julialang.org/t/how-to-properly-store-a-compile-time-integer-constant-with-a-struct/34293 "2020-02-07T18:19:30Z")

</div>

I am developing a tree-like data structure for a numerical simulation package, based on a composite type named Tree. To keep things general, I keep the implementation dimension-agnostic, so it should work with 1D, 2D, an…

---

## [How would I pass in a boolean condition to index a Julia Dataframe](https://discourse.julialang.org/t/how-would-i-pass-in-a-boolean-condition-to-index-a-julia-dataframe/34306)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 2\
**Last updated:** [February 7, 2020, 4:52pm UTC](https://discourse.julialang.org/t/how-would-i-pass-in-a-boolean-condition-to-index-a-julia-dataframe/34306 "2020-02-07T16:52:58Z")

</div>

Hi how’s it going? Say I set a variable X = Symbol(“column1”).==“Yes” How would I pass that variable in to index just like I would if I passed the actual statement in: data\[data\[Symbol("column1)\].==“Yes”, :\]

---

## [Problem using Overrides.toml](https://discourse.julialang.org/t/problem-using-overrides-toml/34296)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 3\
**Last updated:** [February 7, 2020, 4:10pm UTC](https://discourse.julialang.org/t/problem-using-overrides-toml/34296 "2020-02-07T16:10:47Z")

</div>

Hi all, I’m trying to follow the instructions at 8. Artifacts · Pkg.jl to override the libcxxwrap-julia binaries (so I can use my local development version), using the following Overrides.toml file: \[3eaa8342-bff7-56a5…

---

## [Usage of isdefined() function](https://discourse.julialang.org/t/usage-of-isdefined-function/34304)

<div class="topic-metadata">

**Author:** [@spaceLem](https://discourse.julialang.org/u/spaceLem)\
**Replies:** 2\
**Last updated:** [February 7, 2020, 3:18pm UTC](https://discourse.julialang.org/t/usage-of-isdefined-function/34304 "2020-02-07T15:18:33Z")

</div>

I recently returned to some code I wrote last year, where I used the isdefined() function. The old syntax was: julia\> x = 1 julia\> isdefined(:x) true julia\> isdefined(:y) false But since then isdefined() has changed an…

---

## [Suggestion: forcing Travis CI to render verbose build output](https://discourse.julialang.org/t/suggestion-forcing-travis-ci-to-render-verbose-build-output/14716)

<div class="topic-metadata">

**Author:** [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Replies:** 2\
**Last updated:** [February 7, 2020, 1:14pm UTC](https://discourse.julialang.org/t/suggestion-forcing-travis-ci-to-render-verbose-build-output/14716 "2020-02-07T13:14:27Z")

</div>

Pkg3 currently directs all output from the Pkg.build() process to a log file. That’s generally nice, as it keeps the terminal from filling up with tens of thousands of lines of autotools output, but it’s a hassle on Trav…

---

## [Ampersand Operator not consistent with help?](https://discourse.julialang.org/t/ampersand-operator-not-consistent-with-help/34266)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 15\
**Last updated:** [February 7, 2020, 10:13am UTC](https://discourse.julialang.org/t/ampersand-operator-not-consistent-with-help/34266 "2020-02-07T10:13:07Z")

</div>

help?\> & search: & &(x, y) But if I try it, it doesn’t work: julia\> &((1==2),(1==1)) ERROR: syntax: invalid syntax &(Core.tuple(==(1, 2), ==(1, 1))) Stacktrace: \[1\] top-level scope at none:0 julia\> &(true,true) …

---

## [Best way to query the values of a struct with array of symbols](https://discourse.julialang.org/t/best-way-to-query-the-values-of-a-struct-with-array-of-symbols/34259)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 10\
**Last updated:** [February 7, 2020, 9:35am UTC](https://discourse.julialang.org/t/best-way-to-query-the-values-of-a-struct-with-array-of-symbols/34259 "2020-02-07T09:35:10Z")

</div>

I have an struct with some fields. Based on the types provided by the user at construction, I want the struct to remember certain fields of interest. I achieved this this way mutable struct Foo{T} a::T b::T …

---

## [How to stop \`show\` from printing a type's fully qualified name?](https://discourse.julialang.org/t/how-to-stop-show-from-printing-a-types-fully-qualified-name/34274)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 3\
**Last updated:** [February 7, 2020, 9:09am UTC](https://discourse.julialang.org/t/how-to-stop-show-from-printing-a-types-fully-qualified-name/34274 "2020-02-07T09:09:15Z")

</div>

Say I have a type, X, and I overload its show(). When the type name comes up in other contexts, such as in an array, it still prints the fully qualified name: julia\> module M struct X x …

---

## [How do retrieve all vectors as from an array of vectors](https://discourse.julialang.org/t/how-do-retrieve-all-vectors-as-from-an-array-of-vectors/34288)

<div class="topic-metadata">

**Author:** [@PyDataBlog](https://discourse.julialang.org/u/PyDataBlog)\
**Replies:** 2\
**Last updated:** [February 7, 2020, 9:06am UTC](https://discourse.julialang.org/t/how-do-retrieve-all-vectors-as-from-an-array-of-vectors/34288 "2020-02-07T09:06:38Z")

</div>

Hello everyone. Basically, I have an array of vectors like this: a = \[ \[5, 3, 2\], \[5, 3, 5\], \[8, 4, 6\] \] which looks like this: 3-element Array{Array{Int64,1},1}: \[5, 3, 2\] \[5, 3, 5\] \[8, 4, 6\] I want to retriev…

---

## [Markdown output in jupyter noteboks](https://discourse.julialang.org/t/markdown-output-in-jupyter-noteboks/34238)

<div class="topic-metadata">

**Author:** [@HenrikM](https://discourse.julialang.org/u/HenrikM)\
**Replies:** 4\
**Last updated:** [February 7, 2020, 7:44am UTC](https://discourse.julialang.org/t/markdown-output-in-jupyter-noteboks/34238 "2020-02-07T07:44:48Z")

</div>

In Python it seems to be easy to output markdown in a jupyter notebook, see SO: Is it possible to show print output as LaTeX in jupyter notebook? SO: How to programmatically generate markdown output in Jupyter notebook…

---

## [How to obtain the frequency/phase/power of a signal and then produce a waveform of arbitrary length from those parameters?](https://discourse.julialang.org/t/how-to-obtain-the-frequency-phase-power-of-a-signal-and-then-produce-a-waveform-of-arbitrary-length-from-those-parameters/33896)

<div class="topic-metadata">

**Author:** [@mantzaris](https://discourse.julialang.org/u/mantzaris)\
**Replies:** 6\
**Last updated:** [February 7, 2020, 6:34am UTC](https://discourse.julialang.org/t/how-to-obtain-the-frequency-phase-power-of-a-signal-and-then-produce-a-waveform-of-arbitrary-length-from-those-parameters/33896 "2020-02-07T06:34:59Z")

</div>

I have a waveform signal X1 in the time domain that is long enough for all of the frequency components to have completed multiple periods, and want to derive the frequency, phase and amplitude/power components. With tho…

---

## [@code\_warntype does not produce a helpful output when called with keyword arguments](https://discourse.julialang.org/t/code-warntype-does-not-produce-a-helpful-output-when-called-with-keyword-arguments/34279)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 3\
**Last updated:** [February 7, 2020, 5:58am UTC](https://discourse.julialang.org/t/code-warntype-does-not-produce-a-helpful-output-when-called-with-keyword-arguments/34279 "2020-02-07T05:58:21Z")

</div>

Hello, I noticed @code\_warntype does not produce a helpful output when the function in question has keyword arguments. Is there a way to call @code\_warntype, such that we get more information? Here is a minimal example…

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

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