Julia Has Amazing Indexing

How Julia makes it easy to access data stored in structures.

Emma Boudreau
chifi

--

introduction

Indexing is an essential concept in programming that allows us to get elements of a collection by providing an index that references that element. For a Vector or list , this index is usually the element’s position in the Vector . For a dictionary, indexing is usually done with the keys of that dictionary. The return of an index call will always be an element or multiple elements from the original structure. Understanding that this is how we extract data for use from data-structures, it is easy to see why indexing is an important aspect of a programming language.

I program in a diverse sub-set of languages, so I am often exposed to a myriad of different approaches to indexing from different languages that reside in different paradigms. Among these approaches, few stand out more than Julia. Working in Julia makes working with data-structures a lot more intuitive, and I have found that I now want other programming languages to be more like Julia on the front of indexing.

(short and sweet) notebook

indexing

One of the important things to learn in a transition to Julia is that indexes start at 1 . While this is not the standard in…

--

--

Responses (1)