This is a Jupyter Notebook in the Julia programming language by Oleg Lavrovsky based on Jupyter Notebooks : a powerful data analysis and wrangling tool (Python resources here) facilitated by Jan Krause (EPFL Library) at DataJamDays 2017.
24.11.2017 | Crative Commons License: CC BY-SA 4.0
Notebooks are for Math!
\begin{equation*} \left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right) \end{equation*}
Notebooks are interactive!
a = 3*2
Notebooks are REALLY interactive!
using Gadfly, Interact
@manipulate for ϕ=0:π/16:4π, f=[:sin => sin, :cos => cos]
plot(θ -> f(θ + ϕ), 0, 25)
end
And of course, we can print stuff too:
print("Hello")
println(" World")
lists_are_fun = [1, 2, 3]
for n in lists_are_fun
print("$n.. ")
end
Plot some points and curves:
plot(x=1:10, y=2.^rand(10),
Scale.y_sqrt, Geom.point, Geom.smooth)
Doing math in Julia is more fun!
equation(x) = (x + 2) * (x - 1) * (x - 2) + √(4 - x^2)
plot(equation, 0, 2)
As is working with Open Data:
using DataFrames, Requests
OPENDATA = get("https://data.stadt-zuerich.ch/dataset/stst_schulwesen/resource/e5ec0f06-46ef-4c49-872f-a18603e2d92b/download/tstst31.csv")
io = IOBuffer(readstring(OPENDATA))
T = readtable(io, separator=';')
T[1:4,:]
"$(T[4,1]) had $(T[4,2]) kids in school in 2011"
string_to_float(str) = try parse(Int32, str) catch return(0) end
T[:Schüler_Total_2010_2011] = map(string_to_float, T[:Schüler_Total_2010_2011])
T[:Schüler_Maturitätsschulen_2010_2011] = map(string_to_float, T[:Schüler_Maturitätsschulen_2010_2011])
T[1:4]
plot(T[1:10, :], x=:Stadtname, y=Col.value(
:Schüler_Total_2010_2011,
:Schüler_Maturitätsschulen_2010_2011
), color=Col.index(
:Schüler_Total_2010_2011,
:Schüler_Maturitätsschulen_2010_2011
)
)
If you have questions about this, please visit https://forum.schoolofdata.ch