Giter Club home page Giter Club logo

juliafordataanalysis's Introduction

Julia for Data Analysis

This repository contains source codes for the "Julia for Data Analysis" book that has been written by Bogumił Kamiński and has been published by Manning Publications Co.

Contents

Additional teaching materials

  • in the /exercises folder for each book chapter you can find 10 additional exercises with solutions (they are meant for self study and are not discussed in the book)
  • in the /lectures folder for each book chapter you can find a Jupyter Notebook file with code from this chapter (note that the code is slightly adjusted in comparison to code contained in .jl files in the root folder to accommodate it for running in Jupyter Notebook).

Setting up your environment

General instructions

In order to prepare the Julia environment before working with the materials presented in the book please perform the following setup steps:

  • download and install Julia; all the codes were tested under Julia 1.7 (under never versions of Julia the code will work, but you might get warning messages when loading packages due to the fact that their versions are pinned in this repository);
  • make sure you can start Julia by running julia command in your terminal;
  • download this repository to a local folder on your computer;
  • start Julia in a folder containing the downloaded material using the command julia --project; the folder must contain the Project.toml and Manifest.toml files prepared for this book that allow Julia to automatically set up the project environment that will allow you to work with material presented in this book (a more detailed explanation what these files do and why they are required is given in appendix A to the book);
  • press ], write instantiate and press Enter (this process will ensure that Julia properly configures the working environment for working with the codes from the book); in some cases running the resolve command also might be required;
  • press Backspace, write exit() and press Enter; now you should exit Julia and everything is set up to work with the materials presented in the book.

Additional instructions how to manage your Julia installation are given in appendix A to the book. In particular I explain there how to perform a correct configuration of your environment when doing:

  • integration with Python using the PyCall.jl package;
  • integration with R using the RCall.jl package;
  • installation of Plots.jl (which by default uses the GR Framework that requires installation of extra dependencies on operating system level under Linux).

In particular, if you use Visual Studio Code with Julia extension then open the folder with the materials contained in this repository (you can open it in Folder/Open Folder... menu option). Then if you run Start Julia REPL command (e.g. under Windows its keyboard shortcut is Alt-J Alt-O) a proper project environment will be automatically activated (the Julia extension will use the Project.toml and Manifest.toml files that are present in this folder).

Note for Linux users

Installation of Julia under Linux requires that you choose the folder to which you extract the precompiled binaries you have downloaded. Next, assuming that you extracted Julia in, for example, the /opt folder, the simplest way to make sure that your system can find julia executable is to add it to your system PATH environment variable. A standard way to do it is to edit your ~/.bashrc (or ~/.bash_profile) file and add there the:

export PATH="$PATH:/opt/julia-1.7.2/bin"

line (assuming you have downloaded Julia 1.7.2 and extracted it to /opt folder).

Dev Containers

Folder /.devcontainer contains configuration files for Dev Containers.

Organization of the code

The codes for each chapter are stored in files named chXX.jl, where XX is chapter number. The exceptions are

  • chapter 14, where additionally a separate ch14_server.jl is present along with ch14.jl (the reason is that in this chapter we create a web service and the ch14_server.jl contains the server-side code that should be run in a separate Julia process);
  • appendix A, where the file name used is appA.txt because it also contains other instructions than only Julia code (in particular package manager mode instructions).

Solutions to the exercises that are presented in appendix B in the book are stored in appB.jl file. These solutions assume that they are executed in the same Julia session as the codes from the chapter where the question was posted (so that appropriate variables and functions are defined and appropriate packages are loaded).

Running the example codes

To work with codes from some given chapter:

  • it is recommended to use a machine with at least 8GB of RAM when working with the examples in this book (some examples require more RAM, which is clearly indicated in the book);
  • start a fresh Julia session using the julia --project command in a folder containing the downloaded material (or alternatively use Visual Studio Code to activate the appropriate project environment automatically);
  • execute the commands sequentially as they appear in the file; the codes were prepared in a way that you do not need to restart Julia when working with material from a single chapter, unless it is explicitly written in the instructions to restart Julia (some of the codes require this); when you move to a new chapter start a new Julia session;
  • before each code there is a comment allowing you to locate the relevant part of the book where it is used; if in the code there is a blank line between consecutive code sections this means that in the book these codes are separated by the text of the book explaining what the code does;

Accompanying materials

There are the following videos that feature material related to this book:

Data used in the book

For your convenience I additionally stored data files that we use in this book. They are respectively:

Citation

Plain text (Chicago style):

Kamiński, Bogumił. 2023. Julia for Data Analysis. Manning.

BibTeX:

@book{Kaminski2023,
  title     = "Julia for Data Analysis",
  author    = "Kamiński, Bogumił",
  year      = 2023,
  publisher = "Manning",
  address   = "Shelter Island, NY"
}

Errata

You can find errata for the book in this file.

juliafordataanalysis's People

Contributors

benz0li avatar bkamins avatar mo-gul avatar pitmonticone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

juliafordataanalysis's Issues

Odd behavior in Julia 1.8.5 on Linux Mint 20.3

This seems really odd... any ideas what I'm doing wrong?

glenn@glenn-OMEN-875 ~/src/github.com/bkamins/JuliaForDataAnalysis (main) $ julia --version
julia version 1.8.5
glenn@glenn-OMEN-875 ~/src/github.com/bkamins/JuliaForDataAnalysis (main) $ LD_LIBRARY_PATH="" julia -q --project
(JuliaForDataAnalysis) pkg> instantiate
┌ Warning: The active manifest file has dependencies that were resolved with a different julia version (1.7.3). Unexpected behavior may occur.
└ @ ~/src/github.com/bkamins/JuliaForDataAnalysis/Manifest.toml:0

julia> include("ch02.jl")
ERROR: LoadError: cannot document the following expression:

0.1

Stacktrace:
 [1] error(::String, ::String)
   @ Base ./error.jl:44
 [2] top-level scope
   @ ~/src/github.com/bkamins/JuliaForDataAnalysis/ch02.jl:9
 [3] include(fname::String)
   @ Base.MainInclude ./client.jl:476
 [4] top-level scope
   @ REPL[2]:1
in expression starting at /home/glenn/src/github.com/bkamins/JuliaForDataAnalysis/ch02.jl:9

julia> versioninfo()
Julia Version 1.8.5
Commit 17cfb8e65ea (2023-01-08 06:45 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 8 on 16 virtual cores
Environment:
  LD_LIBRARY_PATH = 
  JULIA_NUM_THREADS = 8

julia> 

make code from non-"julia modes" comments

I think I would make stuff that is not in "julia" mode comments. This avoids that this stuff is shown as "Parsing error" in VS Code (and most likely other IDEs). For example

?₁

could be changed to

# In REPL
# - change to "help mode" by pressing `?` key
# - type `₁` (or copy/paste it there)
# - type `ε` (or copy/paste it there)
# - return to "julia mode" by pressing `backspace` key

What do you think about that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.