operator
modulefunctools
moduleitertools
moduletoolz
, fn
and funcy
modulesmrjob
operator
modulefunctools
moduleitertools
moduletoolz
, fn
and funcy
modulesmrjob
from __future__ import division
import os
import sys
import glob
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
%matplotlib inline
%precision 4
plt.style.use('ggplot')
You will need to install Julia from http://julialang.org/downloads/ and
make sure it is on your path. On Ubuntu you can install via apt-get
with
sudo add-apt-repository ppa:staticfloat/juliareleases
sudo add-apt-repository ppa:staticfloat/julia-deps
sudo apt-get update
sudo apt-get install julia
Within an instance of Julia, run the following commands:
Pkg.update()
Pkg.add("PyCall")
Pkg.add("IJulia")
Then finally install pyjulia
from
https://github.com/JuliaLang/pyjulia
Make sure that you can start julia
line - if not, add a symlink to
it.
%install_ext https://raw.githubusercontent.com/JuliaLang/pyjulia/master/julia/magic.py
Installed magic.py. To use it, type:
%load_ext magic
%load_ext magic
%julia @pyimport matplotlib.pyplot as plt
%julia @pyimport numpy as np
%julia @pyimport numpy.random as npr
Initializing Julia interpreter. This may take some time...
%%julia
function fib(n)
a, b = 0.0, 1.0
for i = 1:n
a, b = a+b, a
end
return a
end
<PyCall.jlwrap fib>