Counting functions

In data exploration, counting over a range is often done. It helps to find out the most/least occurring value. Julia provides the counts function to count over a range. Let's say we have an array of values. For our convenience, we will now use the random function to create an array:

Counting functions

We have created an array of 30 values ranging from 1 to 5. Now we want to know how many times they occur in the dataset:

Counting functions

Using the count function, we found that 1(7), 2(1), 3(5), 4(11), and 5(6). counts take different arguments to suit the use case. ...

Get Julia for Data Science now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.