# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1328

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

**Page:** 1329

---

## [Same command works in Jupyter and REPL but not in Vscode](https://discourse.julialang.org/t/same-command-works-in-jupyter-and-repl-but-not-in-vscode/64697)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 1\
**Last updated:** [July 17, 2021, 12:23pm UTC](https://discourse.julialang.org/t/same-command-works-in-jupyter-and-repl-but-not-in-vscode/64697 "2021-07-17T12:23:46Z")

</div>

I am using this command to import a csv file. zhvi = CSV.File("data/zhvi.csv") |\> DataFrame It works in Jupyter and REPL (when I create a new folder) but in Vscode (using an environment that results from cloning a repo…

---

## [ModelingToolkit: Different ways to access array of variables](https://discourse.julialang.org/t/modelingtoolkit-different-ways-to-access-array-of-variables/59939)

<div class="topic-metadata">

**Author:** [@jairorua](https://discourse.julialang.org/u/jairorua)\
**Replies:** 3\
**Last updated:** [July 17, 2021, 10:57am UTC](https://discourse.julialang.org/t/modelingtoolkit-different-ways-to-access-array-of-variables/59939 "2021-07-17T10:57:46Z")

</div>

Hello, Let’s consider a general function that aims at being a reusable pin/connector of arrays of variables. using ModelingToolkit function arrayConnection(;name, discretizations = 4) @parameters t @variables x\[1:d…

---

## [Collapsible code sections in discourse?](https://discourse.julialang.org/t/collapsible-code-sections-in-discourse/64803)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 3\
**Last updated:** [July 17, 2021, 10:00am UTC](https://discourse.julialang.org/t/collapsible-code-sections-in-discourse/64803 "2021-07-17T10:00:11Z")

</div>

Sorry if this might be trivial but have no idea of how to do it: Saw on a number of occasions “collapsible” Julia code blocks in discourse posts. Cannot find an example right now but basically the hidden code expands a…

---

## [Package Development](https://discourse.julialang.org/t/package-development/64798)

<div class="topic-metadata">

**Author:** [@JulianDwain](https://discourse.julialang.org/u/JulianDwain)\
**Replies:** 4\
**Last updated:** [July 17, 2021, 8:09am UTC](https://discourse.julialang.org/t/package-development/64798 "2021-07-17T08:09:13Z")

</div>

Hi everyone, I am trying to start using Julia for developing my own package (just for fun), but I am having trouble using my module in, what I call them, “local test files”. Lets assume I have the following project str…

---

## [What is the difference between x .= and x\[:\] =](https://discourse.julialang.org/t/what-is-the-difference-between-x-and-x/64790)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 2\
**Last updated:** [July 17, 2021, 8:03am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-x-and-x/64790 "2021-07-17T08:03:19Z")

</div>

julia\> x = \[1,2,3\] 3-element Vector{Int64}: 1 2 3 In this case they are the same. Are they always the same? What is the difference? julia\> x .= \[10, 20, 30\] 3-element Vector{Int64}: 10 20 30 julia\> x\[:\] = \[11, 2…

---

## [Trouble creating a type to be a vector of another defined type](https://discourse.julialang.org/t/trouble-creating-a-type-to-be-a-vector-of-another-defined-type/64786)

<div class="topic-metadata">

**Author:** [@mistamista](https://discourse.julialang.org/u/mistamista)\
**Replies:** 3\
**Last updated:** [July 17, 2021, 4:25am UTC](https://discourse.julialang.org/t/trouble-creating-a-type-to-be-a-vector-of-another-defined-type/64786 "2021-07-17T04:25:15Z")

</div>

So what I want to do is something like: Define a type Point that is constructed from floats passed by the user. This is supposed to store the coordinates of a point. struct Point x::Float64 y::Float64 end This works…

---

## [Counterintuitive array update allocations](https://discourse.julialang.org/t/counterintuitive-array-update-allocations/63490)

<div class="topic-metadata">

**Author:** [@ismedina](https://discourse.julialang.org/u/ismedina)\
**Replies:** 11\
**Last updated:** [July 17, 2021, 3:59am UTC](https://discourse.julialang.org/t/counterintuitive-array-update-allocations/63490 "2021-07-17T03:59:32Z")

</div>

I’ve run into a kind-of counterintuitive behavior when coding some example. I have an array A\_field, which I want to update by adding certain values in certain positions. These are provided by a an array of arrays of (fl…

---

## [Symbolics.jl Jacobian](https://discourse.julialang.org/t/symbolics-jl-jacobian/64654)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 6\
**Last updated:** [July 17, 2021, 3:53am UTC](https://discourse.julialang.org/t/symbolics-jl-jacobian/64654 "2021-07-17T03:53:30Z")

</div>

I have searched far and wide and have no luck setting up a script to do a Jacobian calculation using Symbolics.jacobian. Can someone shoot me example syntax for a vector of symbolics. I get errors that look like this: …

---

## [GeometryBasics Rect](https://discourse.julialang.org/t/geometrybasics-rect/64779)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 2\
**Last updated:** [July 17, 2021, 2:42am UTC](https://discourse.julialang.org/t/geometrybasics-rect/64779 "2021-07-17T02:42:40Z")

</div>

Rect says Construct a HyperRectangle enclosing all points. which it does, but I think there is a better rectangle for this job than the one returned. julia\> Rect(Circle(Point((0.,0.)), 1.)) Rect2D{Float64}(\[-1.0, -1…

---

## [Join vs innerjoin and pkg updating](https://discourse.julialang.org/t/join-vs-innerjoin-and-pkg-updating/64778)

<div class="topic-metadata">

**Author:** [@davidoff](https://discourse.julialang.org/u/davidoff)\
**Replies:** 10\
**Last updated:** [July 17, 2021, 1:30am UTC](https://discourse.julialang.org/t/join-vs-innerjoin-and-pkg-updating/64778 "2021-07-17T01:30:55Z")

</div>

I have the same version of Julia and same Pkg.update() vintage on 2 different computers. On one, when I merge data frames, I use join() and the other innerjoin() – on each of the two computers, the alternative join comma…

---

## [How to write matrix data to Excel in separate worksheets?](https://discourse.julialang.org/t/how-to-write-matrix-data-to-excel-in-separate-worksheets/64557)

<div class="topic-metadata">

**Author:** [@adikaagas](https://discourse.julialang.org/u/adikaagas)\
**Replies:** 4\
**Last updated:** [July 17, 2021, 1:05am UTC](https://discourse.julialang.org/t/how-to-write-matrix-data-to-excel-in-separate-worksheets/64557 "2021-07-17T01:05:57Z")

</div>

I have matrix data type that stored in atom workspace called sheet1 = \[1 2 3; 4 5 6\] and sheet2 = \[1 1 1; 2 2 2\] how do i write this variable into excel workbook with a different worksheet? xlxs.addsheet! didnt work , …

---

## [From Zero to Jupyter-lab on Linux for Julians?](https://discourse.julialang.org/t/from-zero-to-jupyter-lab-on-linux-for-julians/64762)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 8\
**Last updated:** [July 16, 2021, 10:31pm UTC](https://discourse.julialang.org/t/from-zero-to-jupyter-lab-on-linux-for-julians/64762 "2021-07-16T22:31:58Z")

</div>

I have a new computer since the last time I used Jupyter-lab. I use Jupyter-lab just for Julia, and so have no need for python stuff other than as infrastructure for things like Jupyter. I installed IJulia.jl and Conda.…

---

## [Help with Turing.jl model using Categorical, Normal and ordered constraint](https://discourse.julialang.org/t/help-with-turing-jl-model-using-categorical-normal-and-ordered-constraint/64765)

<div class="topic-metadata">

**Author:** [@Hakan\_Kjellerstrand](https://discourse.julialang.org/u/Hakan_Kjellerstrand)\
**Replies:** 2\
**Last updated:** [July 16, 2021, 9:05pm UTC](https://discourse.julialang.org/t/help-with-turing-jl-model-using-categorical-normal-and-ordered-constraint/64765 "2021-07-16T21:05:06Z")

</div>

I’m trying to model AllenDowney’s three problems “How tall is A?” (How tall is A? – Probably Overthinking It ): 1) Suppose you meet an adult resident of the U.S. who is 170 cm tall. What is the probability that th…

---

## [Feedback to coding attempts (new to Julia)](https://discourse.julialang.org/t/feedback-to-coding-attempts-new-to-julia/64772)

<div class="topic-metadata">

**Author:** [@johanneswerner](https://discourse.julialang.org/u/johanneswerner)\
**Replies:** 2\
**Last updated:** [July 16, 2021, 9:03pm UTC](https://discourse.julialang.org/t/feedback-to-coding-attempts-new-to-julia/64772 "2021-07-16T21:03:35Z")

</div>

Hello, I recently started using Julia (earlier I used Python and R), and currently I am using a few resources (below) to get used to the language. exercism projecteuler advent of code rosalind (bioinformatics-related …

---

## [Problem with lyap(Q,R)](https://discourse.julialang.org/t/problem-with-lyap-q-r/64745)

<div class="topic-metadata">

**Author:** [@ylish](https://discourse.julialang.org/u/ylish)\
**Replies:** 11\
**Last updated:** [July 16, 2021, 8:34pm UTC](https://discourse.julialang.org/t/problem-with-lyap-q-r/64745 "2021-07-16T20:34:48Z")

</div>

Hello everybody, I am new to Julia and I am trying to rewrite and improve some code that I have in MATLAB. I have come across something that I cannot fix. Could someone see what the issue is? I have the following code: …

---

## [Wrong image when trying to create a simple 3d surface](https://discourse.julialang.org/t/wrong-image-when-trying-to-create-a-simple-3d-surface/64767)

<div class="topic-metadata">

**Author:** [@rodolforbcoutinho](https://discourse.julialang.org/u/rodolforbcoutinho)\
**Replies:** 1\
**Last updated:** [July 16, 2021, 8:19pm UTC](https://discourse.julialang.org/t/wrong-image-when-trying-to-create-a-simple-3d-surface/64767 "2021-07-16T20:19:52Z")

</div>

Hi. I’m Trying to plot a 3D triangle plane using Plots.jl and surface. But an odd extra surface is showing up. Can someone tell-me what i’m doing wrong? Code below with some experiments. Thanks in advance!!! using Plot…

---

## [Order of groupedbar](https://discourse.julialang.org/t/order-of-groupedbar/64749)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [July 16, 2021, 7:32pm UTC](https://discourse.julialang.org/t/order-of-groupedbar/64749 "2021-07-16T19:32:10Z")

</div>

I have the following plot of a Likert scale: StatsPlots.groupedbar( repeat(questions, outer = 5), weights, group=repeat(\["1", "2", "3", "4", "5"\], inner=length(questions)), bar\_position=:stack, o…

---

## [Save code generated by macro to file](https://discourse.julialang.org/t/save-code-generated-by-macro-to-file/64760)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 7\
**Last updated:** [July 16, 2021, 7:26pm UTC](https://discourse.julialang.org/t/save-code-generated-by-macro-to-file/64760 "2021-07-16T19:26:32Z")

</div>

I have a string macro that generates a lot of code, and I would like to store this code in a Julia file such that I can just include it the next time it is required. How can I achieve this? I assume it has to be realized…

---

## [Distributed Differential Equations with large matrix](https://discourse.julialang.org/t/distributed-differential-equations-with-large-matrix/64665)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 12\
**Last updated:** [July 16, 2021, 7:11pm UTC](https://discourse.julialang.org/t/distributed-differential-equations-with-large-matrix/64665 "2021-07-16T19:11:07Z")

</div>

Hello, I’m trying to increase the performances for my differential equation system, where the differential function is function drho\_dt(rho, p, t) global L, L\_t A, w\_l = p return (L + A \* sin(w\_l \* t) \* L\_t…

---

## [Handling of package inter-dependency](https://discourse.julialang.org/t/handling-of-package-inter-dependency/64568)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 37\
**Last updated:** [July 16, 2021, 4:00pm UTC](https://discourse.julialang.org/t/handling-of-package-inter-dependency/64568 "2021-07-16T16:00:13Z")

</div>

Introduction Hello. I am currently developing a software involving A GUI in C# / vb.net A computation kernel in julia To handle to communication business I am using Json.net for the C# part and the BSON package in jul…

---

## [Collect values in a dict](https://discourse.julialang.org/t/collect-values-in-a-dict/64626)

<div class="topic-metadata">

**Author:** [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Replies:** 10\
**Last updated:** [July 16, 2021, 3:53pm UTC](https://discourse.julialang.org/t/collect-values-in-a-dict/64626 "2021-07-16T15:53:13Z")

</div>

I have a list of pairs of dog-owners and dog-names. The dog-names are non-unique, and I want to collect a dict keyed on the dog-names where the values are the owners having a dog of that name. Here’s an example using n…

---

## [Messed up environment UUID?](https://discourse.julialang.org/t/messed-up-environment-uuid/64651)

<div class="topic-metadata">

**Author:** [@orome](https://discourse.julialang.org/u/orome)\
**Replies:** 5\
**Last updated:** [July 16, 2021, 3:41pm UTC](https://discourse.julialang.org/t/messed-up-environment-uuid/64651 "2021-07-16T15:41:27Z")

</div>

I’ve got some weird behavior with an environment: I renamed a file in the environment’s src and subsequently every time I tried to add or dev any other package with the project activated, I got an error: ERROR: expected…

---

## [Fastmath error?](https://discourse.julialang.org/t/fastmath-error/64750)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 2\
**Last updated:** [July 16, 2021, 1:56pm UTC](https://discourse.julialang.org/t/fastmath-error/64750 "2021-07-16T13:56:34Z")

</div>

v1.6.1, when --math-mode=fast: julia\> f() = exp(1.0); julia\> f() - exp(1.0) 0.002427216033242807 which is obviously wrong. It’s wrong even in fastmath mode! while when --math-mode=ieee, no problem: julia\> f() = exp(…

---

## [Cannot install NBInclude](https://discourse.julialang.org/t/cannot-install-nbinclude/64743)

<div class="topic-metadata">

**Author:** [@Annette\_F](https://discourse.julialang.org/u/Annette_F)\
**Replies:** 2\
**Last updated:** [July 16, 2021, 12:36pm UTC](https://discourse.julialang.org/t/cannot-install-nbinclude/64743 "2021-07-16T12:36:01Z")

</div>

Hello, I’ve got a large program to write in Julia in Jupyter notebooks; so I’d like to split the code over various notebooks. It looks as though I would be able to manage this with the NBInclude package; except I don’t…

---

## [Convex.jl affine constraint not respected in solution](https://discourse.julialang.org/t/convex-jl-affine-constraint-not-respected-in-solution/64741)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 3\
**Last updated:** [July 16, 2021, 12:12pm UTC](https://discourse.julialang.org/t/convex-jl-affine-constraint-not-respected-in-solution/64741 "2021-07-16T12:12:41Z")

</div>

Does anyone know why? Thanks! using LinearAlgebra, Convex, MosekTools rho = HermitianSemidefinite(4) add\_constraint!(rho, tr(rho) == 1) p = satisfy(tr(rho) == 1) solve!(p, Mosek.Optimizer) p.status rho\_opt = round.(eval…

---

## [LoggingExtras.jl -\> Get STRING from LOGGING MACRO](https://discourse.julialang.org/t/loggingextras-jl-get-string-from-logging-macro/64731)

<div class="topic-metadata">

**Author:** [@Michal](https://discourse.julialang.org/u/Michal)\
**Replies:** 4\
**Last updated:** [July 16, 2021, 10:23am UTC](https://discourse.julialang.org/t/loggingextras-jl-get-string-from-logging-macro/64731 "2021-07-16T10:23:59Z")

</div>

How can I get string message from log macro? @info "My message" I used FormatLogger so output looks like: 2021-07-16 --- My message --- INFO --- Main.module I would liek to get this full message as a string. How is i…

---

## [Chi-Square test of a sample](https://discourse.julialang.org/t/chi-square-test-of-a-sample/63617)

<div class="topic-metadata">

**Author:** [@Mariana](https://discourse.julialang.org/u/Mariana)\
**Replies:** 19\
**Last updated:** [July 16, 2021, 8:50am UTC](https://discourse.julialang.org/t/chi-square-test-of-a-sample/63617 "2021-07-16T08:50:22Z")

</div>

Hello! I am working on a project in which I was given a random sample, and now I want to identify, among 3 distributions, which one created this sample. By plotting a histogram, it seems that the gamma distribution is …

---

## [A nice use case for DataFrames.jl - flexible dedup](https://discourse.julialang.org/t/a-nice-use-case-for-dataframes-jl-flexible-dedup/64725)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 4\
**Last updated:** [July 16, 2021, 7:53am UTC](https://discourse.julialang.org/t/a-nice-use-case-for-dataframes-jl-flexible-dedup/64725 "2021-07-16T07:53:34Z")

</div>

I had this problem where I need to dedup a dataframe using a column, but there is a timestamp column for all the entries. If two entries have the same data, but different timestamp, I would want ot keep only the one with…

---

## [LoggingExtras.jl - How to add custom log macro](https://discourse.julialang.org/t/loggingextras-jl-how-to-add-custom-log-macro/64679)

<div class="topic-metadata">

**Author:** [@Michal](https://discourse.julialang.org/u/Michal)\
**Replies:** 8\
**Last updated:** [July 16, 2021, 7:34am UTC](https://discourse.julialang.org/t/loggingextras-jl-how-to-add-custom-log-macro/64679 "2021-07-16T07:34:34Z")

</div>

@debug, @info, @warn, @error are by default, I would like to add log macro, f.e. @fatal. How can I do it with LoggingExtras.jl? @fredrikekre Thank you I only tried following code (did not work for LoggingExtras.jl): ma…

---

## [Can I make a Function Call Itself?](https://discourse.julialang.org/t/can-i-make-a-function-call-itself/64067)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 12\
**Last updated:** [July 16, 2021, 7:23am UTC](https://discourse.julialang.org/t/can-i-make-a-function-call-itself/64067 "2021-07-16T07:23:09Z")

</div>

Hi everyone. This might be a REALLY silly question, but I wonder if it is possible. I am making this function Set\_Up(). It is design to load all other functions in my code, force precompilation, load global variables, …

[Previous page](https://discourse.julialang.org/latest.md?page=1327)

[Next page](https://discourse.julialang.org/latest.md?page=1329)
