Skip to content

Instantly share code, notes, and snippets.

View Alexander-Barth's full-sized avatar

Alexander Barth Alexander-Barth

View GitHub Profile
@Alexander-Barth
Alexander-Barth / test_diffusion.jl
Last active October 10, 2019 14:16
1d diffusion in Julia (0.6) and Python (3.5)
using BenchmarkTools
# jmax iterations of a Laplacian smoother
function smooth!(x,jmax)
imax = length(x)
for j = 1:jmax
xm = x[1]
@Alexander-Barth
Alexander-Barth / pcolor_NaN.jl
Last active December 12, 2016 21:28
Simple example how to make a pcolor plot with missing values (equal to NaN) in Julia
# pcolor plot with missing values (equal to NaN) in Julia
using PyCall
@pyimport numpy.ma as ma
# some random data
A = randn(10,10);
A[2,2] = NaN;
# created a Masked Array
# see also