Julia in Action
Chris von Csefalvay
  • ISBN 9781617292835
  • 375 pages
  • printed in black & white
We regret that Manning Publications will not be publishing this title.
Julia in Action teaches you how to use the Julia language to tackle technical programming tasks as well as data processing, analysis, and visualization challenges. You'll begin by setting up your development environment and then you'll dive into the fundamentals: data types, strings, collections, matrices, and control flow. Using real-world examples, you'll learn how to create and use functions and methods along with how and when to use explicit types. You'll master reading and writing files and data, connecting to external data sources, and importing and cleaning real world data. This book also teaches you about parallel programming to help you split complex problems into distributable chunks for faster processing. By the end of this book, you'll be ready to use Julia to solve your scientific programming tasks.

About the Technology

Julia is a newcomer to the technical and scientific programming community currently dominated by R, Matlab, and Python. It was created with lofty goals: a general purpose, easy-to-learn open-source language that's blazingly fast and powerful and built with parallel computing and data science tasks in mind. Although Julia is a new language, its roots are in Lisp, so it comes with mature features like macros and support for other metaprogramming techniques like code generation. Julia's expressive grammar lets you write easy-to-read and easier-to-debug code, and its speed gets you through more work in less time. It's a great choice whether you're designing a machine learning system, crunching statistical data, or writing system utilities.
Table of Contents detailed table of contents

1. Introduction

1.1. Introducing Julia

1.2. Why you should care about Julia

1.2.1. Where Julia excels

1.2.2. Where Julia still needs to catch up

1.3. The flight plan

1.3.1. Take-off

1.3.2. Cruising altitude

1.3.3. Landing

1.3.4. In-flight entertainment

2. First steps: Installing Julia

2.1. Installing Julia

2.1.1. Juliabox

2.1.2. Juno

2.1.3. IJulia

2.2. "Hello, world!" A short introduction to IJulia

2.2.1. First steps

2.2.2. Literate programming in IJulia

2.2.3. Exporting code from the notebook environment

2.3. Summary

3. Julia meets mathematics

3.1. Exploring variables and assignment

3.1.1. Baby's first variables

3.1.2. Naming a variable in Julia well (and badly)

3.2. Operators

3.2.1. Numeric operators

3.2.2. Pipe dreams: the pipe operator (|>)

3.3. Discovering number types in Julia

3.3.1. The idea of a type

3.3.2. Integer types in Julia

3.3.3. Floating away on floating points

3.3.4. To infinity, NaN and beyond!

3.3.5. Exact rational numbers

3.4. Comparisons and values

3.4.1. Numeric comparisons

3.4.2. Comparison chaining

3.4.3. Identity comparison and isequal()

3.5. Putting it all together: calculating inequality

3.6. Summary

4. Strings

4.1. The anatomy of a string in Julia

4.1.1. The building blocks: Chars

4.1.2. Enter the Strings: ASCIIString and UTF strings

4.1.3. String indexing and its pitfalls

4.2. To bigger (and better) strings!

4.2.1. One string, two string: string composition

4.2.2. String interpolation

4.3. String manipulation

4.3.1. Finding a needle in a haystack

4.3.2. Regular expressions

4.3.3. Replacing strings

4.4. Putting it all together: Who speaks in Hamlet?

4.4.1. Loading the text

4.4.2. Finding speakers

4.4.3. Formatting the output

4.5. Summary

5. Indexable collections

5.1. The idea of collections

5.1.1. A taxonomy of collections

5.2. Arrays and tuples

5.2.1. Arrays

5.2.2. Creating arrays

5.2.3. Ranges

5.2.4. Tuples

5.3. Creating arrays using comprehensions

5.3.1. Comprehending comprehensions

5.3.2. The array comprehension syntax

5.4. Accessing, storing and retrieving elements of an indexable collection

5.4.1. Accessing elements in an array

5.4.2. The meaning of indexable collections

5.4.3. push!, pop! and in-place modification of arrays

5.4.4. Elementwise operations

5.5. Unpacking collections for fun and profit

5.6. Higher order functions on indexable collections

5.6.1. Mapping

5.6.2. Filtering

5.6.3. Reducing

5.7. Putting it all together: time series in Julia

5.7.1. Weight by weight, day by day

5.7.2. Applying BMI

5.7.3. Finally, some descriptive statistics!

5.7.4. Finding outlier days

5.8. Summary

6. Associative and set-like collections

6.1. Introducing Dicts

6.1.1. Creating Dicts

6.1.2. Keys, values and hashable types

6.1.3. Dict comprehensions

6.2. Accessing elements of an associative collection

6.2.1. Key errors (and how to avoid them)

6.2.2. To key or not to key

6.2.3. Deleting elements of an associative collection

6.3. Operations on associative collections

6.3.1. Sorting associative collections

6.3.2. Filtering dicts

6.4. Sets

6.4.1. Creating sets and manipulating elements

6.4.2. Set operations

6.5. Putting it all together: representing graphs and social networks using Dicts and Sets

6.5.1. Theory and motivation

6.5.2. Implementing the vertex set and adjacency matrix representations

6.5.3. Social Network Analysis metrics

6.6. Summary

7. Matrices

7.1. Enter the matrix: creating and representing matrices

7.1.1. Creating matrix literals

7.1.2. Using matrix comprehensions

7.1.3. Special matrices

7.1.4. Random matrices

7.1.5. Accessing elements in a matrix

7.2. Matrix operations

7.2.1. Matrix multiplication and transposes in Julia

7.2.2. Matrix division, determinates and linear systems

7.2.3. Iterating over matrices

7.3. Sparse matrices

7.3.1. Battleships and sparse matrices

7.3.2. Creating and manipulating sparse matrices in Julia

7.4. DataFrames and DataArrays

7.4.1. Why use DataFrames?

7.4.2. Beyond the Matrix: Data Frames

7.4.3. Creating and accessing data in Data Frames

7.4.4. Filtering a DataFrame

7.4.5. Iterating over DataFrames and applying functions

7.5. Putting it all together: Statistical applications of DataFrames

7.5.1. Summary statistics by variables

7.5.2. Aggregating data

7.5.3. Statistical modeling with DataFrames

7.5.4. Conclusion

8. Controlling the flow

8.1. Going with the flow

8.1.1. Block party

8.1.2. In the beginning: compound statements

8.2. Conditional evaluation (if-elseif-else)

8.2.1. How is a conditional clause structured?

8.2.2. Order matters!

8.2.3. Dripping pipes and leaky scopes

8.2.4. Alternatives to conditional clauses: ternary operator

8.2.5. Alternatives to conditional clauses: Boolean switching

8.3. Iteration (while and for)

8.3.1. While away the time´┐Ż

8.3.2. Creating a for loop

8.3.3. Escaping loops: break and continue

8.4. When things go wrong: exception handling in Julia

8.4.1. Raising hell (and Exceptions)

8.4.2. Playing catch!

8.5. Putting it all together: a lot of ways to write FizzBuzz

8.5.1. Iterating over

8.5.2. Using a while loop

8.5.3. DRYing up our code

8.6. Conclusion

9. Functions

9.1. Understanding functions

9.2. Syntax: declaring functions

9.2.1. Anonymous functions: stabby lambdas

9.2.2. Anonymous functions: do blocks

9.2.3. What’s in a name? Creating named functions in Julia

9.2.4. Named and unnamed parameters

9.2.5. Variadic arguments

9.2.6. Parametric types

9.3. The function type: functions within the language

9.3.1. Functions as operators

9.3.2. Functions, methods and multiple dispatch

9.3.3. Pure generics

9.4. Scope: variables inside (and outside) functions

9.5. Higher order functions and functions acting on functions

9.5.1. MapReduce: a practical example of higher order functions

9.5.2. Function composition

9.6. Putting it all together: writing MapReduce in Julia

9.6.1. Obtaining the data set

9.6.2. The Map stage

9.6.3. The Reduce stage

9.6.4. Concluding remarks

9.7. Conclusion

10. Types, conversion and promotion

11. I/O and file system management

12. Parallel programming

13. Metaprogramming, reflection and introspection

14. Packages, modules and package management

15. Epilogue: Onto bigger and better things


Appendix A: Testing and profiling

Appendix B: Invoking non-Julia code

What's inside

  • Julia from the ground up
  • Types, methods, and multiple dispatch
  • Parallel programming and efficient code
  • Metaprogramming and macros

About the reader

This book is suitable for data scientists to general purpose developers to engineers. You should have some programming experience. No specialized mathematical or data science experience is assumed.

About the author

Chris von Csefalvay uses Julia in his position as a data scientist specializing in machine learning. He's an author, contributor, and committer on more than fifty open-source projects.

placing your order...

Don't refresh or navigate away from the page.

FREE domestic shipping on three or more pBooks