# General Usage

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

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

**Page:** 891

---

## [Best way to iteratively add to a DataFrame?](https://discourse.julialang.org/t/best-way-to-iteratively-add-to-a-dataframe/21084)

<div class="topic-metadata">

**Author:** [@torgo](https://discourse.julialang.org/u/torgo)\
**Replies:** 8\
**Last updated:** [February 23, 2019, 10:03am UTC](https://discourse.julialang.org/t/best-way-to-iteratively-add-to-a-dataframe/21084 "2019-02-23T10:03:38Z")

</div>

I would like to do something like this: using DataFrames dflong = DataFrame() for i = 1:3 df = DataFrame(a = rand(i)) vcat(dflong, df) end I understand that this doesn’t work for two reasons: dflong cannot b…

---

## [Julia slower in Windows](https://discourse.julialang.org/t/julia-slower-in-windows/21027)

<div class="topic-metadata">

**Author:** [@donquicote](https://discourse.julialang.org/u/donquicote)\
**Replies:** 16\
**Last updated:** [February 23, 2019, 8:56am UTC](https://discourse.julialang.org/t/julia-slower-in-windows/21027 "2019-02-23T08:56:10Z")

</div>

Hello, I’m running this simple piece of code in two different computers: using BenchmarkTools function testing() rand(1000000) end @btime testing() HP EliteBook 840 G3. i5-6300U 2.4Ghz. 16GB DRR4. Windows 10. 4…

---

## [How to get sol.du in DifferentialEquations.jl](https://discourse.julialang.org/t/how-to-get-sol-du-in-differentialequations-jl/21093)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 3\
**Last updated:** [February 23, 2019, 1:48am UTC](https://discourse.julialang.org/t/how-to-get-sol-du-in-differentialequations-jl/21093 "2019-02-23T01:48:24Z")

</div>

Hello, I am solving an ODE with DifferentialEquations.jl. I would like to access to the derivative of the solution at every time step via sol.du. In the documentation( http://docs.juliadiffeq.org/latest/basics/solution…

---

## [Is there an idiom for "do this N times"?](https://discourse.julialang.org/t/is-there-an-idiom-for-do-this-n-times/21061)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 19\
**Last updated:** [February 23, 2019, 1:38am UTC](https://discourse.julialang.org/t/is-there-an-idiom-for-do-this-n-times/21061 "2019-02-23T01:38:28Z")

</div>

I am performing some simulations where a statistical model is used first to simulate a new response then to fit the response then to extract quantities of interest. The current code is function parametricbootstrap(N::I…

---

## [Portable installation of Julia?](https://discourse.julialang.org/t/portable-installation-of-julia/21097)

<div class="topic-metadata">

**Author:** [@outlace](https://discourse.julialang.org/u/outlace)\
**Replies:** 2\
**Last updated:** [February 22, 2019, 11:04pm UTC](https://discourse.julialang.org/t/portable-installation-of-julia/21097 "2019-02-22T23:04:23Z")

</div>

I want to use Julia on my poorly HD endowed Macbook Air but with all packages and whatnot it takes up several gigabytes. Can I install everything on an external hard drive and have a portable installation of Julia? I can…

---

## [Closure bug (#15276) hits again with multi-threading, but why?!](https://discourse.julialang.org/t/closure-bug-15276-hits-again-with-multi-threading-but-why/21082)

<div class="topic-metadata">

**Author:** [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Replies:** 1\
**Last updated:** [February 22, 2019, 9:18pm UTC](https://discourse.julialang.org/t/closure-bug-15276-hits-again-with-multi-threading-but-why/21082 "2019-02-22T21:18:12Z")

</div>

Hello, Below is a MWE of what I am seeing in an application: function foo(v) #uncomment for Box size(v) == (10,10) && error() ss=zeros(Float64,Threads.nthreads()) #this does not lead to Box #si…

---

## [Adding a Unitful unit to a vector with missings is slow](https://discourse.julialang.org/t/adding-a-unitful-unit-to-a-vector-with-missings-is-slow/21085)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 4\
**Last updated:** [February 22, 2019, 8:25pm UTC](https://discourse.julialang.org/t/adding-a-unitful-unit-to-a-vector-with-missings-is-slow/21085 "2019-02-22T20:25:57Z")

</div>

I have a vector with a million floats, and some missing values. I want to say that it’s a vector of meters. On Julia 1.0.3: julia\> using BenchmarkTools, Unitful julia\> v = vcat(fill(1.0, 500000), missing, fill(1.0, 500…

---

## [Is there an idiom for constructing a heterogeneous tuple?](https://discourse.julialang.org/t/is-there-an-idiom-for-constructing-a-heterogeneous-tuple/21094)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 1\
**Last updated:** [February 22, 2019, 7:57pm UTC](https://discourse.julialang.org/t/is-there-an-idiom-for-constructing-a-heterogeneous-tuple/21094 "2019-02-22T19:57:59Z")

</div>

So, is there a preferred way for for i = 1:5 ... end with N known to the compiler, that permits type-instability with respect to i? That is, each iteration might have entirely different types, and might need entirely di…

---

## [Exception\_access\_violation](https://discourse.julialang.org/t/exception-access-violation/21072)

<div class="topic-metadata">

**Author:** [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Replies:** 1\
**Last updated:** [February 22, 2019, 4:15pm UTC](https://discourse.julialang.org/t/exception-access-violation/21072 "2019-02-22T16:15:46Z")

</div>

I’m getting the error below - it seems to reference different points in my code each time I run it. I can’t easily create a MWE. Any ideas? Please submit a bug report with steps to reproduce this fault, and any error me…

---

## [Iterate on expression](https://discourse.julialang.org/t/iterate-on-expression/21083)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 2\
**Last updated:** [February 22, 2019, 4:02pm UTC](https://discourse.julialang.org/t/iterate-on-expression/21083 "2019-02-22T16:02:23Z")

</div>

Why would one ever want to iterate over expressions? Well its like that: I have a recursive function on expr, to replace a Symbol with a given expression. ersatz(ex::Symbol,a::Symbol,b) = ex==a ? deepcopy(b) : ex ersat…

---

## [Get rid of Missing in eltype](https://discourse.julialang.org/t/get-rid-of-missing-in-eltype/21079)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 6\
**Last updated:** [February 22, 2019, 3:35pm UTC](https://discourse.julialang.org/t/get-rid-of-missing-in-eltype/21079 "2019-02-22T15:35:17Z")

</div>

I tried but couldn’t find an efficient way to “convert” a v::Vector{Union{Missing, T}} to Vector{T} if there are if fact no missings, and throw an error otherwise. \[v...\] works for converting, but as I understand it is i…

---

## [Return type of reshape](https://discourse.julialang.org/t/return-type-of-reshape/21060)

<div class="topic-metadata">

**Author:** [@maxtremblay](https://discourse.julialang.org/u/maxtremblay)\
**Replies:** 8\
**Last updated:** [February 22, 2019, 3:15pm UTC](https://discourse.julialang.org/t/return-type-of-reshape/21060 "2019-02-22T15:15:24Z")

</div>

Hello, What are the rules that dictate the behavior of the reshape function. It seems that, most of the time, an Array object is returned. However, sometimes an Base.ReshapedArray object is returned. I have hard time fi…

---

## [mul! much slower than \* for QRCompactWYQ](https://discourse.julialang.org/t/mul-much-slower-than-for-qrcompactwyq/17258)

<div class="topic-metadata">

**Author:** [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Replies:** 5\
**Last updated:** [February 22, 2019, 11:01am UTC](https://discourse.julialang.org/t/mul-much-slower-than-for-qrcompactwyq/17258 "2019-02-22T11:01:11Z")

</div>

Suppose I have generated the following QRCompactWYQ: Q = qr(randn(500, 10)).Q; and I want to do in-place multiplication of Q with x = randn(500) to y = randn(500) i.e. @btime mul!(y, Q, x) This runs in 2.9s in my…

---

## [An error related to JuMP and Clp: symbol lookup error: /home/paalon/.julia/packages/Clp/GpVOR/deps/usr/lib/libClp.so: undefined symbol: dgetrf\_](https://discourse.julialang.org/t/an-error-related-to-jump-and-clp-symbol-lookup-error-home-paalon-julia-packages-clp-gpvor-deps-usr-lib-libclp-so-undefined-symbol-dgetrf/19737)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 4\
**Last updated:** [February 22, 2019, 8:25am UTC](https://discourse.julialang.org/t/an-error-related-to-jump-and-clp-symbol-lookup-error-home-paalon-julia-packages-clp-gpvor-deps-usr-lib-libclp-so-undefined-symbol-dgetrf/19737 "2019-02-22T08:25:49Z")

</div>

I randomly encounter the following error only in Linux (Mac doesn’t show this error) when I try to solve a linear programming by JuMP and Clp: julia: symbol lookup error: /home/paalon/.julia/packages/Clp/GpVOR/deps/usr/…

---

## [Julia messes up integer exponents?](https://discourse.julialang.org/t/julia-messes-up-integer-exponents/20773)

<div class="topic-metadata">

**Author:** [@MrRobot](https://discourse.julialang.org/u/MrRobot)\
**Replies:** 106\
**Last updated:** [February 21, 2019, 11:59pm UTC](https://discourse.julialang.org/t/julia-messes-up-integer-exponents/20773 "2019-02-21T23:59:02Z")

</div>

I was using avogadro’s number in a calculation and couldn’t figure out why the results were not matching my matlab or python code… Turns out using integers as exponents gets you in trouble in Julia?They start off innoce…

---

## [Error using Package manager through VPN Linux server, Private repository](https://discourse.julialang.org/t/error-using-package-manager-through-vpn-linux-server-private-repository/21041)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 3\
**Last updated:** [February 21, 2019, 10:55pm UTC](https://discourse.julialang.org/t/error-using-package-manager-through-vpn-linux-server-private-repository/21041 "2019-02-21T22:55:34Z")

</div>

Hi, I get the following error when trying to install a package for a private repository when SSHing to a sever through a VPN connection. Stacktrace included below. Any ideas. Is it a git issue? This installs fine when…

---

## [Can print affect the behavior of a script?](https://discourse.julialang.org/t/can-print-affect-the-behavior-of-a-script/20526)

<div class="topic-metadata">

**Author:** [@maxtremblay](https://discourse.julialang.org/u/maxtremblay)\
**Replies:** 3\
**Last updated:** [February 7, 2019, 9:52pm UTC](https://discourse.julialang.org/t/can-print-affect-the-behavior-of-a-script/20526 "2019-02-07T21:52:05Z")

</div>

Hi everyone, I have a really strange problem. I have a simulation software that I’m developing. When I run my tests, the results may change depending on what I print. An example will be clearer I suppose. I run my test…

---

## [How to add "build step" and "tests" in a new julia package?](https://discourse.julialang.org/t/how-to-add-build-step-and-tests-in-a-new-julia-package/21058)

<div class="topic-metadata">

**Author:** [@Mahbubar06](https://discourse.julialang.org/u/Mahbubar06)\
**Replies:** 2\
**Last updated:** [February 21, 2019, 9:51pm UTC](https://discourse.julialang.org/t/how-to-add-build-step-and-tests-in-a-new-julia-package/21058 "2019-02-21T21:51:27Z")

</div>

Hello, I wanted to create a julia package. For that i followed the following steps: (v1.1) pkg\> generate HelloWorld shell\> cd HelloWorld (v1.1) pkg\> activate . julia\> import HelloWorld julia\> HelloWorld.greet() The ou…

---

## [CUDA not working on Ubuntu 18.04](https://discourse.julialang.org/t/cuda-not-working-on-ubuntu-18-04/21045)

<div class="topic-metadata">

**Author:** [@francesco.alemanno](https://discourse.julialang.org/u/francesco.alemanno)\
**Replies:** 2\
**Last updated:** [February 21, 2019, 6:09pm UTC](https://discourse.julialang.org/t/cuda-not-working-on-ubuntu-18-04/21045 "2019-02-21T18:09:59Z")

</div>

Hello Everyone! I tried to use CuArrays with CudaNative on ubuntu 18.04 with CudaToolkit release 9.1, V9.1.85 with Nvidia Grap Driver 390.77 (obtained through the recommended procedure “apt install nvidia-cuda-toolk…

---

## [How to set up Travis dependency for an external unregistered package?](https://discourse.julialang.org/t/how-to-set-up-travis-dependency-for-an-external-unregistered-package/20995)

<div class="topic-metadata">

**Author:** [@pszufe](https://discourse.julialang.org/u/pszufe)\
**Replies:** 5\
**Last updated:** [February 21, 2019, 4:18pm UTC](https://discourse.julialang.org/t/how-to-set-up-travis-dependency-for-an-external-unregistered-package/20995 "2019-02-21T16:18:45Z")

</div>

This is typical problem I have when working with GitHub and the solution seems to be undocumented: I have an unregistered package A on GitHub I have an unregistered package B on GitHub the package B references the pack…

---

## [Poor performance of abspath](https://discourse.julialang.org/t/poor-performance-of-abspath/20853)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 7\
**Last updated:** [February 21, 2019, 3:35pm UTC](https://discourse.julialang.org/t/poor-performance-of-abspath/20853 "2019-02-21T15:35:47Z")

</div>

I’m running some stress tests on Genie apps and literally, the first thing that broke the app was a repeated call to abspath. I’m not sure if this can be improved, but if not, maybe the docs can point to the fact that it…

---

## [How to preserve custom type after broadcasting?](https://discourse.julialang.org/t/how-to-preserve-custom-type-after-broadcasting/21047)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 1\
**Last updated:** [February 21, 2019, 2:27pm UTC](https://discourse.julialang.org/t/how-to-preserve-custom-type-after-broadcasting/21047 "2019-02-21T14:27:53Z")

</div>

I’d like to preserve the custom type after it has been broadcasted. Currently I have the following: struct SigmaPoints{T} \<: AbstractMatrix{T} x0::Array{T, 1} xi::Array{T, 2} end Base.size(S::SigmaPoints) = (siz…

---

## [A way to push to a JSON IO like with a collection](https://discourse.julialang.org/t/a-way-to-push-to-a-json-io-like-with-a-collection/20990)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 10\
**Last updated:** [February 21, 2019, 10:42am UTC](https://discourse.julialang.org/t/a-way-to-push-to-a-json-io-like-with-a-collection/20990 "2019-02-21T10:42:38Z")

</div>

I’m running a somewhat long and slow iteration. I want to incrementally save the result of each iteration in a singular JSON file. The problem is that when the file is closed (because of early termination or because the …

---

## [DataFrames deleterows! broken?](https://discourse.julialang.org/t/dataframes-deleterows-broken/21003)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 10\
**Last updated:** [February 21, 2019, 8:21am UTC](https://discourse.julialang.org/t/dataframes-deleterows-broken/21003 "2019-02-21T08:21:02Z")

</div>

I’m still trying to figure out a MWE. I’m encountering a weird issue as follows where df is a DataFrame and d is Vector{Int64}. Any idea? julia\> deleterows!(df, d) ERROR: MethodError: no method matching deleteat!(::Ba…

---

## [Generic functions between mutability](https://discourse.julialang.org/t/generic-functions-between-mutability/20983)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 6\
**Last updated:** [February 21, 2019, 1:30am UTC](https://discourse.julialang.org/t/generic-functions-between-mutability/20983 "2019-02-21T01:30:41Z")

</div>

There is often the question of whether to go for mutable types, like Array or BigInt, or for bitstypelike SVector or Int. The former demand careful management of temporaries, use of views and inplace operations; these ar…

---

## [Missing \`append!\` method?](https://discourse.julialang.org/t/missing-append-method/21019)

<div class="topic-metadata">

**Author:** [@danielmatz](https://discourse.julialang.org/u/danielmatz)\
**Replies:** 2\
**Last updated:** [February 21, 2019, 1:05am UTC](https://discourse.julialang.org/t/missing-append-method/21019 "2019-02-21T01:05:12Z")

</div>

I just tried to do the following: append!(\[1, 2\], \[3, 4\], \[5, 6\]) And was surprised to find that there’s no such method. I was expecting it to be the equivalent of: append!(append!(\[1, 2\], \[3, 4\]), \[5, 6\]) Is this j…

---

## [REQUIRE - set upper limit in package](https://discourse.julialang.org/t/require-set-upper-limit-in-package/21022)

<div class="topic-metadata">

**Author:** [@holger](https://discourse.julialang.org/u/holger)\
**Replies:** 5\
**Last updated:** [February 20, 2019, 9:05pm UTC](https://discourse.julialang.org/t/require-set-upper-limit-in-package/21022 "2019-02-20T21:05:22Z")

</div>

How do I set an upper limit in REQUIRE in my package? Example is that I want to use JuMP v0.18 and NOT 0.19. When adding JuMP 0.18.5 to my REQUIRE, travis-ci still gives me an error because it uses 0.19. Thanks alread…

---

## [Trait inheritance](https://discourse.julialang.org/t/trait-inheritance/21021)

<div class="topic-metadata">

**Author:** [@datnamer](https://discourse.julialang.org/u/datnamer)\
**Replies:** 4\
**Last updated:** [February 20, 2019, 8:52pm UTC](https://discourse.julialang.org/t/trait-inheritance/21021 "2019-02-20T20:52:36Z")

</div>

Is it possible to dispatch on a trait inheritance hierarchy without invoking dynamic dispatch?

---

## [CSV.read() won't accept just a file name?](https://discourse.julialang.org/t/csv-read-wont-accept-just-a-file-name/21009)

<div class="topic-metadata">

**Author:** [@kirboone](https://discourse.julialang.org/u/kirboone)\
**Replies:** 3\
**Last updated:** [February 20, 2019, 5:58pm UTC](https://discourse.julialang.org/t/csv-read-wont-accept-just-a-file-name/21009 "2019-02-20T17:58:51Z")

</div>

I’m trying to load a .csv file into a DataFrame using: data = CSV.file(“filename.csv”) |\> DataFrame Where “filename.csv” exists in the same folder as my Julia program file. According to online resources, this seems to…

---

## [How are called in Julia terminology Int64, Float64,... vs Array{T,1}, Tuple{T1,T2,...}, Set{T},](https://discourse.julialang.org/t/how-are-called-in-julia-terminology-int64-float64-vs-array-t-1-tuple-t1-t2-set-t/21006)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 5\
**Last updated:** [February 20, 2019, 12:53pm UTC](https://discourse.julialang.org/t/how-are-called-in-julia-terminology-int64-float64-vs-array-t-1-tuple-t1-t2-set-t/21006 "2019-02-20T12:53:20Z")

</div>

Just to ask which is the correct terminology to differentiate Int64, Float64, Bool, Char, String (that I notices is not an Array of chars) on one side vs Array{T,N}, Tuple{T1,T2,…}, Set{T}, Dict{}…, and in general T1{T2…

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

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