Julia language: a concise tutorial
  • Introduction
  • Language core
    • 1 - Getting started
    • 2 - Data types
    • 3 - Control flow
    • 4 - Functions
    • 5 - Custom structures
    • 6 - Input - Output
    • 7 - Managing run-time errors (exceptions)
    • 8 - Interfacing Julia with other languages
    • 9 - Metaprogramming
    • 10 - Performance (parallelisation, debugging, profiling..)
    • 11 - Developing Julia packages
  • Useful packages
    • Plotting
    • DataFrames
    • JuMP
    • SymPy
    • Weave
    • LAJuliaUtils
    • IndexedTables
    • Pipe
Powered by GitBook
On this page
  1. Useful packages

LAJuliaUtils

PreviousWeaveNextIndexedTables

Last updated 4 years ago

is my personal repository for utility functions, mainly for dataframes.

As it is not a registered Julia package, use it with :add https://github.com/sylvaticus/LAJuliaUtils.jl.git

It implements the following functions:

  • addCols!(df, colsName, colsType) - Adds to the DataFrame empty column(s) colsName of type(s) colsType

  • pivot(df::AbstractDataFrame, rowFields, colField, valuesField; <kwd args>) - Pivot and optionally filter and sort in a single function

  • customSort!(df, sortops) - Sort a DataFrame by multiple cols, each specifying sort direction and custom sort order

  • toDict(df, dimCols, valueCol) - Convert a DataFrame in a dictionary, specifying the dimensions to be used as key and the one to be used as value.

  • findall(pattern,string,caseSensitive=true) - Find all the occurrences of pattern in string

In particular the pivot() function accepts the following arguments:

  • df::AbstractDataFrame: the original dataframe, in stacked version (dim1,dim2,dim3... value)

  • rowFields: the field(s) to be used as row categories (also known as IDs or keys)

  • colField::Symbol: the field containing the values to be used as column headers

  • valuesField::Symbol: the column containing the values to reshape

  • ops=sum: the operation(s) to perform on the data, default on summing them

  • filter::Dict: an optional filter, in the form of a dictionary of column_to_filter => [list of ammissible values]

  • sort: optional row field(s) to sort

While an updated, expanded and revised version of this chapter is available in "Chapter 9 - Working with Data" of , this tutorial remains in active development.

LAJuliaUtils
Antonello Lobianco (2019), "Julia Quick Syntax Reference", Apress