Book Image

Julia 1.0 Programming Cookbook

By : Bogumił Kamiński, Przemysław Szufel
Book Image

Julia 1.0 Programming Cookbook

By: Bogumił Kamiński, Przemysław Szufel

Overview of this book

Julia, with its dynamic nature and high-performance, provides comparatively minimal time for the development of computational models with easy-to-maintain computational code. This book will be your solution-based guide as it will take you through different programming aspects with Julia. Starting with the new features of Julia 1.0, each recipe addresses a specific problem, providing a solution and explaining how it works. You will work with the powerful Julia tools and data structures along with the most popular Julia packages. You will learn to create vectors, handle variables, and work with functions. You will be introduced to various recipes for numerical computing, distributed computing, and achieving high performance. You will see how to optimize data science programs with parallel computing and memory allocation. We will look into more advanced concepts such as metaprogramming and functional programming. Finally, you will learn how to tackle issues while working with databases and data processing, and will learn about on data science problems, data modeling, data analysis, data manipulation, parallel processing, and cloud computing with Julia. By the end of the book, you will have acquired the skills to work more effectively with your data
Table of Contents (18 chapters)
Title Page
Copyright and Credits
Dedication
About Packt
Contributors
Preface
Index

Index

A

  • abstract array protocol
    • reference / See also
  • Abstract Syntax Tree (AST) / Introduction
  • Amazon Machine Image (AMI) / There's more...
  • Amazon Web Services (AWS) / Getting ready, There's more...
  • Anaconda
    • download link / Running JupyterLab with Anaconda on Linux
  • Apache POI
    • reference / There's more...
  • ARGB
    • reference / Getting ready
  • array
    • index of random minimum element, finding / Finding the index of a random minimum element in an array, How it works..., There's more...
    • reference / There's more...
  • array protocol / There's more...
  • array views
    • used, for avoiding memory allocation / Using array views to avoid memory allocation, Getting ready, How to do it..., There's more...
  • Atom
    • reference / Juno
    • installation link / Juno
  • AWS cloud
    • Julia, executing in Cloud9 IDE / Running Julia inside the Cloud9 IDE in the AWS cloud, See also
  • AWS RDS (Amazon Web Services Relational Database Service)
    • reference / Getting Oracle JDBC drivers

B

  • 64-bit Xorshift / Getting ready
  • barrier function / There's more...
  • Bayesian bootstrap
    • reference / There's more...
  • BenchmarkTools.jl package
    • reference / There's more...
  • BlackBoxOptim.jl package
    • reference / See also
  • bootstrapping method
    • reference / Getting ready
  • built-in system streams (stdin, stdout, stderr)
    • interacting with / Built-in system streams (stdin, stdout, stderr)

C

  • Cascadia.jl
    • reference / How it works...
  • categorical arrays
    • reference / See also
  • categorical data
    • working with / Working with categorical data, How it works...
  • Cloud9
    • reference / How it works...
  • Cloud Formation Cluster ( CfnCluster)
    • reference / There's more...
  • code
    • benchmarking / Benchmarking code, How it works..., There's more...
  • code performance
    • improving, with @inbounds / Improving code performance using @inbounds, How it works..., There's more...
    • annotations, reference / There's more...
  • column-major order / How it works...
  • comma-separated value (CSV)
    • reading / Reading CSV and FWF files, How it works..., There's more...
  • complex logging
    • reference / See also
  • complex numbers
    • working with / Working with complex numbers, How it works...
    • reference / There's more...
  • computation results
    • displaying / Displaying computation results in Julia, How it works...
  • conditional statements
    • used, for executing loops / How it works..., There's more...
  • ConEmu
    • reference /
  • contravariance
    • reference / There's more...
  • CSV data
    • reading, from internet / Reading CSV data from the internet, How it works...
  • custom pseudo-random number generator
    • implementing / Implementing a custom pseudo-random number generator, How it works..., See also
  • Cycler Boot Mode / There's more...

D

  • data
    • sorting, ways / Non-standard ways to sort your data, How it works...
    • fetching, from internet / Fetching data from the internet, How it works..., See also
    • converting, between / Converting data between DataFrame and Matrix, There's more...
  • database APIs
    • reference / See also
  • database systems
    • working with / Working with databases in Julia, There's more...
    • MySQL / Getting ready for MySQL
    • PostgreSQL / Getting ready for PostgreSQL
    • reference / How it works...
  • data frame
    • contents, investigating / Investigating the contents of a data frame, How it works...
    • converting, between wide and narrow formats / Converting a data frame between wide and narrow formats, There's more...
    • comparing, for identity / Comparing data frames for identity, How it works..., There's more...
  • DataFrames
    • and Matrix , data conversions / Converting data between DataFrame and Matrix, There's more...
    • split-apply-combine pattern / Split-apply-combine in DataFrames, How it works..., See also
    • rows, transforming / Transforming rows of DataFrame, How it works...
  • Date module
    • working with / Working with date and time, How to do it..., How it works..., There's more..., See also
  • dictionaries
    • working / Creating a function preimage - understanding how dictionaries and sets work, How it works..., See also
  • distributed computing
    • reference / See also
    • with Julia / Distributed computing with Julia, Getting ready, How to do it...
  • Distributed module / See also
  • double factorial / Getting ready

E

  • Emacs
    • used, for configuring Julia / Configuring Julia with Emacs
  • end-of-file (EOF) state / Reading and writing files
  • entity-attribute-value model / Converting a data frame between wide and narrow formats
  • Euclidean norm
    • reference / Getting ready
  • exponential distribution
    • reference / Getting ready

F

  • factorial designs
    • generating / Generating full factorial designs, How to do it..., How it works...
  • Feather data
    • handling / Handling Feather data, How to do it..., How it works...
    • documentation, reference / See also
  • files
    • writing / Managing streams, and reading and writing files, Reading and writing files, There's more...
    • reading / Managing streams, and reading and writing files, Reading and writing files, There's more...
  • fixed-width files (FWF)
    • reading / Reading CSV and FWF files, How it works..., There's more...
  • functional programming
    • about / Functional programming in Julia
    • working / How to do it..., How it works...
  • function preimage
    • creating / Creating a function preimage - understanding how dictionaries and sets work, How it works..., There's more...
  • functions
    • using, as variables / Using functions as variables in Julia, There's more...

G

  • @generated macro
    • used, for loop unrolling / Loop unrolling with the @generated macro, How it works..., There's more...
  • Gaussian integer / Getting ready
  • generated functions / Macros and generated functions
  • Genie.jl
    • reference / See also
  • Git
    • reference / Getting ready
  • Git logs
    • parsing, with regular expressions / Parsing Git logs with regular expressions, How to do it..., How it works...
  • GLM.jl
    • reference / There's more...

H

  • High Performance Computing (HPC) / There's more...
  • Hypertext Transfer Protocol (HTTP) / How it works...

I

  • @inbounds
    • used, for improving code performance / Improving code performance using @inbounds, How it works..., There's more...
  • IE Enhanced Security Configuration / There's more...
  • in-memory streams
    • working with, IOBuffer used / Using IOBuffer to efficiently work with in-memory streams, There's more..., See also
  • indexing protocol / There's more...
  • input/output (I/O) / Getting ready
  • Integrated Desktop Environments (IDEs) / Julia IDEs
  • Intel
    • website link / Option 2 - build Julia with Intel MKL (without Intel LIBM)
  • Intel C++ compilers
    • reference / Option 3 - build Julia with Intel MKL and with Intel LIBM
  • Intel LIBM
    • reference / How it works...
  • Intel Math Library
    • reference / Option 3 - build Julia with Intel MKL and with Intel LIBM
  • Intel Parallel Studio XE
    • reference / Option 3 - build Julia with Intel MKL and with Intel LIBM
  • IOBuffer
    • used, for working with in-memory streams / Using IOBuffer to efficiently work with in-memory streams, There's more..., See also
  • IProfile.jl package / See also
  • Iris
    • reference / Getting ready
  • iteration protocol
    • reference / See also

J

  • Java
    • installation link / Configuring JDBC in Julia
  • JavaScript Object Notation (JSON) data
    • working with / Working with JSON data, How it works...
    • reference / See also
  • JDBC (Java Database Connectivity)
    • about / Working with databases in Julia, Getting ready for JDBC and Oracle
    • Oracle / Getting ready for JDBC and Oracle
    • configuring / Configuring JDBC in Julia
  • Julia
    • installing, from binaries / Installing Julia from binaries
    • installing, on Linux Ubuntu / Installing Julia on Linux Ubuntu
    • reference / Installing Julia on Linux Ubuntu, Configuring Julia with Nano, See also
    • installing, on Windows /
    • support for text editors / Julia support for text editors
    • configuring, with Nano / Configuring Julia with Nano
    • configuring, with Vim / Configuring Julia with Vim
    • configuring, with Emacs / Configuring Julia with Emacs
    • building, from sources on Linux / Building Julia from sources on Linux, How to do it...
    • building, without Intel's MKL / Option 1 - build Julia without Intel's MKL
    • building, with Intel MKL (without Intel LIBM) / Option 2 - build Julia with Intel MKL (without Intel LIBM)
    • building, with Intel LIBM / Option 3 - build Julia with Intel MKL and with Intel LIBM
    • building, with Intel MKL / Option 3 - build Julia with Intel MKL and with Intel LIBM
    • compiler scripts, reference / How it works...
    • executing, in Cloud9 IDE / Running Julia inside the Cloud9 IDE in the AWS cloud, See also
    • customizing, on startup / How to customize Julia on startup
    • command, executing on startup / Running a single Julia command on startup
    • script, executing / Running a script every time Julia starts
    • environment variables, reference / There's more...
    • setting up, for multiple core usage / Setting up Julia to use multiple cores, How it works..., There's more...
    • multiple processes, starting / Multiple processes
    • multiple threads / Multiple threads
    • interaction options / Useful options for interaction with Julia, How to do it...
    • computation results, displaying / Displaying computation results in Julia
    • configuration, for working with JupyterLab / Configuring Julia to work with JupyterLab, How it works...
    • configuring with Jupyter Notebook / There's more...
    • executing, as background process / Running Julia as a background process, How it works..., There's more...
    • documentation, reference / There's more...
    • broadcasting / Understanding broadcasting in Julia, How it works..., There's more...
    • broadcasting, reference / See also
    • functions, reference / See also
    • performance issues, reference / See also
    • Python, calling / Calling Python from Julia, How it works...
  • Julia Base.Serialization
    • used, for serializing Julia objects / Serializing Julia objects with Julia Base.Serialization
  • JuliaBox
    • reference / There's more...
  • Julia code
    • profiling, reference / Profiling Julia code
    • profiling / Profiling Julia code, How to do it..., How it works..., See also
    • logging setup / Setting up logging in your code, How to do it...
    • setting up / See also
  • Julia development workflow
    • Revise.jl, using / Julia development workflow with Revise.jl
    • reference / See also
  • JuliaDiff
    • reference / See also
  • Julia Editor Support
    • reference / See also
  • Julia IDEs
    • about / Julia IDEs, How to do it...
    • Juno / Juno
    • Microsoft Visual Studio Code / Microsoft Visual Studio Code
    • Sublime Text / Sublime Text
    • reference / See also
  • JuliaLang
    • reference / See also
  • Julia numeric types
    • structure / Understanding the structure of Julia numeric types with introspection, How to do it..., How it works..., See also
  • Julia objects
    • serializing, with Julia Base.Serialization / Serializing Julia objects with Julia Base.Serialization
    • serializing, with JLD2.jl / Serializing Julia objects with JLD2.jl
    • serializing, with BSON.jl / Serializing Julia objects with BSON.jl
  • Julia set
    • reference / Getting ready
  • Julia startup
    • script, executing / Running a script on Julia startup
    • working / How it works...
  • Julia threading API
    • reference / See also
  • JuMP
    • used, for optimization model definition / Optimization using JuMP, How to do it...
    • reference / How it works...
  • Juno / Juno
  • JupyterLab
    • Julia, configuring / Configuring Julia to work with JupyterLab
    • executing, with Anaconda on Linux / Running JupyterLab with Anaconda on Linux
    • reference / See also
    • Julia, configuring with Jupyter Notebook / How to do it...
  • Jupyter Notebook
    • Julia, configuring / Configuring Julia in Jupyter Notebook
    • executing, within Julia environment / Running Jupyter Notebook from within the Julia environment
    • executing, outside of Julia environment / Running Jupyter Notebook outside of the Julia environment
    • working / How it works...
    • Julia, configuration in terminal-only cloud environments / Configuring Julia with Jupyter Notebook in Terminal-only cloud environments

L

  • Levenberg-Marquardt Method
    • reference / Writing a simple optimization routine
  • LibGit2.jl package
    • reference / There's more...
  • LibPQ.jl package
    • reference / See also
  • likelihood function
    • optimization, performing / Estimation using maximum likelihood, How it works...
    • reference / Getting ready
  • linear regression
    • estimating / Estimating a linear regression, How it works...
  • linked list
    • about / Defining your own types - linked list
    • implementing / Getting ready, How it works...
  • Linux, on AWS Cloud
    • reference / Getting ready
  • Linux Intel MKL
    • reference / How it works...
  • Linux Ubuntu
    • Julia, installing / Installing Julia on Linux Ubuntu
  • long format / Converting a data frame between wide and narrow formats
  • loops
    • executing, with conditional statements / Executing loops efficiently with conditional statements, How to do it..., How it works..., There's more...

M

  • machine learning models
    • building, with ScikitLearn.jl / Building machine learning models with ScikitLearn.jl, How to do it..., How it works...
  • macros
    • about / Macros and generated functions
    • used, for caching function results / Using macros to cache function results
  • Math Kernel Library (MKL) / How to do it...
  • matrices
    • traversing / Traversing matrices efficiently, How it works...
  • matrix
    • creating, from set of vectors as rows / Creating a matrix from a set of vectors as rows, How to do it..., How it works..., There's more...
  • matrix multiplication
    • performing / Fast matrix multiplication, How to do it..., How it works..., There's more...
  • memoization
    • reference / How it works..., See also
  • metaprogramming
    • about / Metaprogramming, How to do it..., How it works...
    • eval() function, working with / Working with the eval function
    • Abstract Syntax Tree (AST) / Abstract Syntax Tree (AST)
    • reference / See also, See also
  • Microsoft Excel files
    • reading / Reading and writing Microsoft Excel files, How it works...
    • writing / Reading and writing Microsoft Excel files, How it works...
    • manipulating, with PyCall.jl and openpyxl / Manipulating Excel files with PyCall.jl and openpyxl
    • manipulating, with XLSX.jl / Manipulating Excel files with XLSX.jl
  • Microsoft Visual Studio Code
    • reference / Microsoft Visual Studio Code
  • missing data
    • handling / Handling missing data, How it works..., There's more...
    • reference / See also
  • modules / Julia development workflow with Revise.jl
  • Monte Carlo simulations
    • reference / Running Monte Carlo simulations
    • executing / Running Monte Carlo simulations, How it works..., There's more...
  • multiple dispatch
    • used, for handling branching behavior / Using multiple dispatch to handle branching behavior, There's more...
  • multiprocessing
    • using / Multiprocessing in Julia, How to do it..., How it works..., There's more...
  • multithreading
    • using / Multithreading in Julia, How it works..., There's more...
  • mutable types
    • versus immutable types / The efficiency of mutable versus immutable types, How to do it..., There's more...
    • working / How it works...
  • MySQL drivers / Getting ready for MySQL
  • MySQL Server
    • connecting, with MySQL.jl / Connecting to MySQL Server with MySQL.jl

N

  • Nano
    • used, for configuring Julia / Configuring Julia with Nano
  • nodes, Julia REPL
    • Julian / How it works...
    • help / How it works...
    • shell / How it works...
    • package manager / How it works...
  • nonlinear constrained optimization
    • reference / There's more...

O

  • object serialization
    • using / Using object serialization in Julia, How to do it..., How it works..., There's more...
    • reference / See also
  • one-hot approach
    • reference / Getting ready
  • openpyxl documentation
    • reference / See also
  • optimization model
    • defining, with JuMP / Optimization using JuMP, How to do it..., There's more...
  • optimization routine
    • writing / Writing a simple optimization routine, How to do it..., How it works..., See also
  • Oracle
    • reference / Getting Oracle JDBC drivers
    • connecting, with JDBC.jl / Connecting to Oracle with JDBC.jl
  • Oracle JDBC drivers
    • obtaining / Getting Oracle JDBC drivers

P

  • packages
    • managing / Managing packages, How it works...
  • ParallelDataTransfer.jl package
    • documentation, reference / See also
  • parametric types
    • reference / See also
  • partial series sums
    • used, for approximating π / How to do it..., How it works..., There's more...
  • Pi Formulas
    • reference / Getting ready
  • pivot tables
    • creating, by chaining transformations of data frames / Creating pivot tables by chaining transformations of data frames, See also
  • pkg
    • reference / There's more...
  • Plots.jl
    • used, for generating plot / Complex plotting with Plots.jl, How to do it..., There's more..., See also
    • reference / See also
  • PostgreSQL
    • connecting, with LibPQ.jl / Connecting to PostgreSQL with LibPQ.jl
    • reference / Connecting to PostgreSQL with LibPQ.jl
  • primitive types
    • defining / Defining primitive types, How to do it..., How it works...
    • reference / See also
  • project dependencies
    • managing / Managing project dependencies, How it works..., There's more...
  • PyCall
    • reference / See also
  • PyPlot.jl package
    • reference / See also
  • Python
    • calling, from Julia / Calling Python from Julia, How it works..., There's more...

Q

  • queuing system
    • analyzing / Analyzing a queuing system, How to do it..., How it works..., There's more...
    • reference / Getting ready

R

  • R
    • calling, from Julia / Calling R from Julia, How to do it..., How it works...
    • libraries, calling from Julia / Option 1 - calling R libraries from Julia
    • direct calling, with / Option 2 - directly calling R from Julia with variable interpolation
    • command line, using / Option 3 - using the R command line available inside Julia with variable interpolation
    • variables, sending / Option 4 - sending variables with their values to R
  • r-base
    • installation link / Getting ready
  • RCall
    • documentation link / Getting ready
  • RCall.jl package
    • reference / See also
  • regular expressions
    • used, for parsing Git logs / Parsing Git logs with regular expressions, How it works...
  • remote Julia processes
    • parameters, sending / Sending parameters to remote Julia processes, How to do it..., How it works..., There's more...
  • REpresentational State Transfer (REST) / Writing a simple RESTful service
  • RESTful service
    • writing / Writing a simple RESTful service, How to do it...
    • web service, building from scratch / Building a web service from scratch
    • web service, building by ZeroMQ and JuliaWebAPI.jl integration / Building a high-performance web service integrating ZeroMQ and JuliaWebAPI.jl, How it works..., There's more...
  • Revise.jl
    • used, for Julia development workflow / Julia development workflow with Revise.jl, How it works...
  • rows, DataFrame
    • transforming / Transforming rows of DataFrame, How it works...

S

  • ScikitLearn.jl
    • used, for building machine learning / Building machine learning models with ScikitLearn.jl, How to do it..., How it works...
    • reference / There's more...
  • scrapy
    • reference / See also
  • sets
    • working / Creating a function preimage - understanding how dictionaries and sets work, How it works..., See also
  • SIMD processor instructions
    • reference / How it works...
  • single instruction multiple data (SIMD) / How it works...
  • split-apply-combine pattern
    • in DataFrames / Split-apply-combine in DataFrames, How it works..., There's more...
  • SSH tunneling
    • reference / See also
  • static arrays
    • using / Using static arrays, How to do it..., There's more...
    • working / How it works...
    • reference / See also
  • statistical profiler / How it works...
  • stderr / How it works...
  • stdin / How it works...
  • stdout / How it works...
  • stream access types
    • sequential / How it works...
    • random access / How it works...
  • streams
    • managing / Managing streams, and reading and writing files, There's more...
  • stream types
    • input streams / How it works...
    • output streams / How it works...
    • input-output streams / How it works...
  • strings
    • reference / See also
  • Sublime Text / Sublime Text
  • subtyping
    • working / Understanding subtyping in Julia, How it works..., There's more...
  • Sudoku
    • reference / Using array views to avoid memory allocation

T

  • Taro package
    • reference / There's more...
  • terminal-only cloud environments
    • Julia, configuring with Jupyter Notebook / Configuring Julia with Jupyter Notebook in Terminal-only cloud environments
  • time
    • working with / Working with date and time, How to do it..., How it works..., There's more...
  • time module
    • working with / Working with date and time, How it works..., There's more...
  • transformations, data frames
    • chaining, for creation of pivot tables / Creating pivot tables by chaining transformations of data frames, See also
  • types
    • reference / There's more...
  • type stability, Julia code
    • used, for detecting problems / Ensuring type stability of your code, How it works...

U

  • UTF-8 strings
    • working with / Working with UTF-8 strings, How to do it..., How it works..., See also

V

  • Vim
    • used, for configuring Julia / Configuring Julia with Vim

W

  • web services / Writing a simple RESTful service
  • wide format / Converting a data frame between wide and narrow formats
  • Windows
    • Julia, installing /

X

  • xlrd package
    • reference / See also
  • XLSX.jl documentation
    • reference / See also
  • XPath language
    • reference / How it works...

Z

  • ZMQ.jl package
    • reference / See also