Quantcast
Channel: First steps - JuliaLang
Browsing all 2795 articles
Browse latest View live

Why Julia values types are inmutable?

In C#, you have structs, that are value types. Value types are types that are passed by value, and can be efficently inlined in stack for example. The more similar thing that I can see in Julia are...

View Article


Converting an array of string types

Hi all, I am doing a small assignment project and this is the second time I am stuck. I have scrapped a website and got the data of the type stated below. Could some one please help me on how to...

View Article


Try/Catch shortcut

Clarification: I’m looking for something similar to: condition ? a : b Except, my condition is when a returns some type of error, then do b instead of a. AZ(x)= try; sqrt(x); catch e; return...

View Article

Dynamic Imports and User Defined Interfaces in Julia

Hello! I am a newcomer to Julia and I am trying to recreate something that I worked a bit on in Python in Julia, because I think Julia will be the better language overall for numerical performance....

View Article

Massive memory allocation on iterating algorithm `8.789115 seconds (26.65 M...

Hey everyone, I’ve written my first major algorithm in Julia which uses a Genetic Algorithm approach to finding a solution to the Travelling Salesman Problem. It works fine but next week I will be...

View Article


Consistent patterns to convert types / find methods for a particular type?

I’ve done a fair amount of Julia programming and understand that “method” means something very different in Python vs Julia, however there are similarities too in that a method has type specificity...

View Article

Image may be NSFW.
Clik here to view.

Joining two DataFrames (no common column)

I am trying to join two DataFrames with no matching columns. Screen Shot 2020-10-13 at 11.13.43 PM707×304 34.8 KB Screen Shot 2020-10-13 at 11.13.25 PM712×305 33.2 KB Please refer to the pics...

View Article

Image may be NSFW.
Clik here to view.

How to reproduce this example

How to reproduce this example in Julia reproducirJulia759×528 45.9 KB 4 posts - 2 participants Read full topic

View Article


Julia kernel of Jupyter

I unintentionally removed Julia kernel from Jupyter note book. after that I tried the code ] build IJulia to get that kernel back to Jupyter but it did not worked out and the Julia kernel folder is...

View Article


Reverse a colormap in GRUtils.jl

I’m using GRUtils. How can I reverse a colormap in GR? I can’t grab cmap = colormap("jet") to flip it or something. The documentation says the colormap values can be retrieved… but doesn’t say how,...

View Article

Cxx/CxxWrap best practices examples

I am in the very early stages of porting a few libraries (all C++) to Julia. I’d like to have Julia wrappers of them first, but I have little experience in this area. Other than the examples in the...

View Article

A* path on graph

Newly introduced to Julia, after working with slow graph libraries in Python. I’m trying to find the shortest path through a graph, constructed through an adjacency matrix using LightGraphs. Part of...

View Article

How to use colon based range syntax with other types?

Hi, I’m still making my first steps with Julia. I have the need for a Range type struct in my code. First I tried to use UnitRange{Int64}. Later I found out that for my needs some of the predefined...

View Article


Vcat vs push!, which one is more efficient

Hi everybody, I’m still a Julia newbie, so don’t be angry at me for silly questions. I’m wondering whenever I should use vcat or push! to append elements to arrays. For example, let’s say I have one...

View Article

Image may be NSFW.
Clik here to view.

String interpolation in docstring

Hey community That’s probably a quick question. I’m writing docstrings and want to show an little example like """ f(s::String)::Nothing # Example for i in 1:10 f("i = $1") end """ function...

View Article


Need help fixing Gibbs Sampler using DArrays

Hi everyone, I’m giving a first steps demonstration to some colleagues. However, I am not an expert in Julia. I wanted to show a simple example of distributed computing with Julia. This is the example...

View Article

Covariance from DataFrame or TimeArray

I have a large data set consisting of daily stock returns over 30 years and 7000 stocks. The time series do not align with each other across the set (i.e. dropmissing(data) returns no rows). If I...

View Article


ScikitLearn: how to import experimental estimator Histogram-Based Gradient...

How can I use the ScikitLearn’s experimental estimator “Histogram-Based Gradient Boosting” in Julia? According to the ScikitLearn Documentation, first from experimental one has to import...

View Article

Can you remove an element from a multidimensal array?

Suppose if I had a 2 dimensional array: a = Int32[1 2 3 4; 5 6 7 8; 9 10 11 12] If I wanted to delete the first element in the second row, can I do that? I attempted to search for myself and I found...

View Article

Image may be NSFW.
Clik here to view.

How do I enable ANSI colored text output within Documenter.jl?

Hi, I’m currently developing a package in which coloring plays an important role. The HTML output of Documenter.jl writes raw ANSI escape codes for text output such as @example as shown in the upper...

View Article
Browsing all 2795 articles
Browse latest View live